about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/smoketest.scm20
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"
       ""