33 lines
523 B
Scheme
33 lines
523 B
Scheme
(import (scheme base)
|
|
(scheme write)
|
|
(retropikzel tap)
|
|
(retropikzel dirt-db)
|
|
(srfi 64))
|
|
|
|
(test-runner-current (tap-runner))
|
|
|
|
(test-begin "dirt-db")
|
|
(define db "/tmp/testdb")
|
|
|
|
(with-db
|
|
db
|
|
(lambda ()
|
|
(write-db "hello" "foobar")))
|
|
|
|
(with-db
|
|
db
|
|
(lambda ()
|
|
(test-equal "foobar" (read-db "hello"))))
|
|
|
|
(with-db-keys
|
|
db
|
|
(lambda (keys)
|
|
(test-equal '("hello") keys)))
|
|
|
|
(with-db-values
|
|
db
|
|
(lambda (vals)
|
|
(test-equal '(("hello" . "foobar")) vals)))
|
|
(test-end "dirt-db")
|
|
|