From 2c1f38b2d66850aaa82bd9479c35a7efd2fc1389 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 27 Feb 2024 14:06:19 -0600 Subject: [PATCH] db.sqlite.lib: fix test --- basis/db/sqlite/lib/lib-tests.factor | 14 ++++++++++++++ basis/db/sqlite/lib/lib.factor | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 basis/db/sqlite/lib/lib-tests.factor 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* ; -- 2.34.1