Mercurial > hg > xemacs-beta
view tests/database.el @ 363:972bbb6d6ca2 r21-1-11
Import from CVS: tag r21-1-11
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:59:28 +0200 |
parents | 4f79e16b1112 |
children | cc15677e0335 |
line wrap: on
line source
;;; Test database functionality (flet ((delete-database-files (filename) (dolist (fn (list filename (concat filename ".db"))) (condition-case nil (delete-file fn) (file-error nil)))) (test-database (db) (Assert (databasep db)) (put-database "key1" "val1" db) (Assert (equal "val1" (get-database "key1" db))) (remove-database "key1" db) (Assert (equal nil (get-database "key1" db))) (close-database db) (Assert (not (database-live-p db))) (Assert (databasep db)))) (let ((filename (expand-file-name "test-harness" (temp-directory)))) (dolist (db-type `(dbm berkeley-db)) (when (featurep db-type) (princ "\n") (delete-database-files filename) (test-database (open-database filename db-type)) (delete-database-files filename)))))