From: Doug Coleman Date: Tue, 27 Feb 2024 20:06:19 +0000 (-0600) Subject: db.sqlite.lib: fix test X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=2c1f38b2d66850aaa82bd9479c35a7efd2fc1389 db.sqlite.lib: fix test --- diff --git a/basis/db/sqlite/lib/lib-tests.factor b/basis/db/sqlite/lib/lib-tests.factor new file mode 100644 index 0000000000..a4fbceea5f --- /dev/null +++ b/basis/db/sqlite/lib/lib-tests.factor @@ -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 + [ current-sqlite-filename file-name ] with-db + ] with-unique-directory drop +] unit-test diff --git a/basis/db/sqlite/lib/lib.factor b/basis/db/sqlite/lib/lib.factor index d89002f349..b492221251 100644 --- a/basis/db/sqlite/lib/lib.factor +++ b/basis/db/sqlite/lib/lib.factor @@ -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* ;