testing: Add few TCL tests for vector extensions

This commit is contained in:
Pekka Enberg 2025-01-28 13:50:52 +02:00
parent ee05ad172b
commit b9c89e79c2
2 changed files with 19 additions and 1 deletions

View file

@ -62,7 +62,7 @@ limbo-wasm:
cargo build --package limbo-wasm --target wasm32-wasi
.PHONY: limbo-wasm
test: limbo test-compat test-sqlite3 test-shell test-extensions
test: limbo test-compat test-vector test-sqlite3 test-shell test-extensions
.PHONY: test
test-extensions: limbo
@ -78,6 +78,10 @@ test-compat:
SQLITE_EXEC=$(SQLITE_EXEC) ./testing/all.test
.PHONY: test-compat
test-vector:
SQLITE_EXEC=$(SQLITE_EXEC) ./testing/vector.test
.PHONY: test-vector
test-sqlite3: limbo-c
LIBS="$(SQLITE_LIB)" HEADERS="$(SQLITE_LIB_HEADERS)" make -C sqlite3/tests test
.PHONY: test-sqlite3

14
testing/vector.test Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env tclsh
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_execsql_test vector-functions-valid {
SELECT vector_extract(vector('[]'));
SELECT vector_extract(vector(' [ 1 , 2 , 3 ] '));
SELECT vector_extract(vector('[-1000000000000000000]'));
} {
{[]}
{[1,2,3]}
{[-1000000000000000000]}
}