]> gitweb.factorcode.org Git - factor.git/commitdiff
db.sqlite.lib: fix test
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 27 Feb 2024 20:06:19 +0000 (14:06 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 27 Feb 2024 20:07:12 +0000 (14:07 -0600)
basis/db/sqlite/lib/lib-tests.factor [new file with mode: 0644]
basis/db/sqlite/lib/lib.factor

diff --git a/basis/db/sqlite/lib/lib-tests.factor b/basis/db/sqlite/lib/lib-tests.factor
new file mode 100644 (file)
index 0000000..a4fbcee
--- /dev/null
@@ -0,0 +1,14 @@
+! Copyright (C) 2024 Doug Coleman.
+! See https://factorcode.org/license.txt for BSD license.
+USING: db db.sqlite db.sqlite.ffi db.sqlite.lib io.files.unique
+io.pathnames kernel namespaces strings tools.test ;
+IN: db.sqlite.lib.tests
+
+{ t } [ sqlite3_libversion string? ] unit-test
+
+{ "test.db" } [
+    [
+        "test.db" current-directory get prepend-path <sqlite-db>
+        [ current-sqlite-filename file-name ] with-db
+    ] with-unique-directory drop
+] unit-test
index d89002f349bb3d8453c84fdf161f5d9c78529ba1..b4922212517acde68acdec845df7b5b0e747477a 100644 (file)
@@ -201,4 +201,4 @@ ERROR: sqlite-error < db-error n string ;
     sqlite3_step sqlite-step-has-more-rows? ;
 
 : current-sqlite-filename ( -- path/f )
-    db-connection get [ handle>> f sqlite3_db_filename ] [ f ] if* ;
\ No newline at end of file
+    db-connection get [ handle>> f sqlite3_db_filename ] [ f ] if* ;