summaryrefslogtreecommitdiff
path: root/gnosis-test.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-07 21:35:18 +0300
committerThanos Apollo <[email protected]>2024-08-07 21:35:18 +0300
commitf1b14fb31b4648ade7ca01c883e2706e06155dcb (patch)
tree832104c03293f45211715664fde9ee73c0dc5c4b /gnosis-test.el
parent1c3eafb6efb05d52a8b01c463d1b47efc1fb2c8e (diff)
test-start: Drop tables instead of creating new db.
Diffstat (limited to 'gnosis-test.el')
-rw-r--r--gnosis-test.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnosis-test.el b/gnosis-test.el
index 1504e02..7b598a0 100644
--- a/gnosis-test.el
+++ b/gnosis-test.el
@@ -127,9 +127,11 @@ If ask nil, leave testing env"
(progn
(unless (file-exists-p testing-dir)
(make-directory testing-dir))
- (when (file-exists-p testing-db)
- (delete-file testing-db))
(setf gnosis-db (emacsql-sqlite-open testing-db))
+ (dolist (table '(decks notes review review-log extras activity-log))
+ (condition-case nil
+ (gnosis--drop-table table)
+ (error (message "No %s table to drop." table))))
(setf gnosis-testing t)
(gnosis-db-init)
(gnosis-test-add-fields note-num)