Initial commit
This commit is contained in:
11
test/README.md
Normal file
11
test/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Testing this extension
|
||||
This directory contains all the tests for this extension. The `sql` directory holds tests that are written as [SQLLogicTests](https://duckdb.org/dev/sqllogictest/intro.html). DuckDB aims to have most its tests in this format as SQL statements, so for the quack extension, this should probably be the goal too.
|
||||
|
||||
The root makefile contains targets to build and run all of these tests. To run the SQLLogicTests:
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
or
|
||||
```bash
|
||||
make test_debug
|
||||
```
|
||||
23
test/sql/quack.test
Normal file
23
test/sql/quack.test
Normal file
@@ -0,0 +1,23 @@
|
||||
# name: test/sql/quack.test
|
||||
# description: test quack extension
|
||||
# group: [quack]
|
||||
|
||||
# Before we load the extension, this will fail
|
||||
statement error
|
||||
SELECT quack('Sam');
|
||||
----
|
||||
Catalog Error: Scalar Function with name quack does not exist!
|
||||
|
||||
# Require statement will ensure this test is run with this extension loaded
|
||||
require quack
|
||||
|
||||
# Confirm the extension works
|
||||
query I
|
||||
SELECT quack('Sam');
|
||||
----
|
||||
Quack Sam 🐥
|
||||
|
||||
query I
|
||||
SELECT quack_openssl_version('Michael') ILIKE 'Quack Michael, my linked OpenSSL version is OpenSSL%';
|
||||
----
|
||||
true
|
||||
Reference in New Issue
Block a user