aboutsummaryrefslogtreecommitdiff
path: root/test/tests.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-02 11:52:08 -0500
committerSean Allred <code@seanallred.com>2014-11-02 11:52:08 -0500
commit7d461a7d4f62d357a224741b9e808f1abada8d15 (patch)
tree08e787919d95d9d4fef2ac3629f3f324ab4efc43 /test/tests.el
parentd2a8e8e9c146c0cce084f7b4e6371a882374435e (diff)
Introduce persistent storage for filters
Diffstat (limited to 'test/tests.el')
-rw-r--r--test/tests.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/tests.el b/test/tests.el
index 44b0de0..fa60364 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -75,3 +75,22 @@
((should-not-go))
((1 . alpha) (2 . beta))]
'(1 2 3)))))
+
+(ert-deftest test-filters ()
+ ;; Ensure the file is empty
+ (ignore-errors
+ (delete-file
+ (stack-cache-get-file-name
+ stack-filter-cache-file)))
+
+ (should-error (stack-filter-store "names must be symbols"
+ "this is a filter"))
+ ;; basic use
+ (should (equal '((test . "filter"))
+ (stack-filter-store 'test "filter")))
+ ;; aggregation
+ (should (equal '((test2 . "filter2") (test . "filter"))
+ (stack-filter-store 'test2 "filter2")))
+ ;; mutation
+ (should (equal '((test2 . "filter2") (test . "filter-test"))
+ (stack-filter-store 'test "filter-test"))))