diff options
| author | Arun Isaac | 2026-10-03 15:21:39 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-10-03 15:21:39 +0100 |
| commit | b51f0ab647a03d7a37018f1c2b5089210b761dcb (patch) | |
| tree | 42e3907887995ba9c2894018d12d657c2efd66cb /tests | |
| parent | 3ca62c21b83bd63d9126fd47aabcb4390e77de46 (diff) | |
| download | guile-xapian-b51f0ab647a03d7a37018f1c2b5089210b761dcb.tar.gz guile-xapian-b51f0ab647a03d7a37018f1c2b5089210b761dcb.tar.lz guile-xapian-b51f0ab647a03d7a37018f1c2b5089210b761dcb.zip | |
Use in-memory database in smoke test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/smoketest.scm | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/tests/smoketest.scm b/tests/smoketest.scm index c1c67e7..7f8e394 100644 --- a/tests/smoketest.scm +++ b/tests/smoketest.scm @@ -52,20 +52,6 @@ (define (fold-count item result) (1+ result)) -;; TODO: Do this with an in-memory database so that we have less -;; cleanup to do. -(define (call-with-temporary-writable-database path proc) - "Like @code{call-with-writable-database}, but delete the database -after." - (dynamic-wind - (const #t) - (cut call-with-writable-database path proc) - (lambda () - (for-each (lambda (file) - (delete-file (string-append path "/" file))) - (scandir path (negate (cut member <> (list "." ".."))))) - (rmdir path)))) - (test-begin "smoketest") (test-equal "version number reporting" @@ -86,7 +72,7 @@ after." data (document-data (make-document #:data data)))) -(call-with-temporary-writable-database "/tmp/xapian-db" +(call-with-in-memory-database (lambda (db) (let ((doc (make-document #:data "is there anybody out there?"))) (add-document! db doc) @@ -145,7 +131,7 @@ after." "Query(WILDCARD SYNONYM wild)" (Query-get-description (new-Query (Query-OP-WILDCARD) "wild" 0))) -(call-with-temporary-writable-database "/tmp/xapian-db" +(call-with-in-memory-database (lambda (db) (let ((enq (enquire db (query-or (query "there") (query "is")))) (doc (make-document #:data "is there anybody out there?"))) @@ -288,7 +274,7 @@ after." #:prefixes prefixes #:boolean-prefixes boolean-prefixes))) -(call-with-temporary-writable-database "/tmp/xapian-db" +(call-with-in-memory-database (lambda (db) (test-equal "get empty database metadata" "" |
