diff options
author | Sean Allred <code@seanallred.com> | 2014-11-01 13:29:10 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-01 13:29:10 -0400 |
commit | b6b0b8dd82031eb55189ad3bea5eaacd8444b9d5 (patch) | |
tree | 700465dcf624682146779a14ae724722edd1908b /test/tests.el | |
parent | 2e9a5dbb953d463ef9e54beb84c6355ff22e35ad (diff) |
More work on data filter; add tests
Diffstat (limited to 'test/tests.el')
-rw-r--r-- | test/tests.el | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/test/tests.el b/test/tests.el index e8452af..cbeb80d 100644 --- a/test/tests.el +++ b/test/tests.el @@ -5,6 +5,19 @@ (if (string-prefix-p "stack-" (symbol-name symbol)) (unintern symbol))))) +(defmacro stack-test-sample-data (method &optional directory) + (with-current-buffer + (find-file-noselect + (concat "data-samples/" + (when directory (concat directory "/")) + method ".el")) + (eval (read (buffer-string))))) + +(setq stack-test-data-questions + (stack-test-sample-data "questions") + stack-test-data-sites + (stack-test-sample-data "sites")) + ;;; Tests (setq stack-core-remaining-api-requests-message-threshold 50000) @@ -44,12 +57,14 @@ "Test the meta-convenience function -- complex structure" (should (equal - '([()]) - (stack-core-filter-data '((0 . 3) - (1 . t) - (a . five) - (2 . [1 2]) - ("5" . bop) - (3) - (p . 4)) - '(1 2 3))))) + '((1 . [a b c]) (2 . [(a . 1)]) (3 . peach)) + (stack-core-filter-data '((1 . [a b c]) + (2 . [(a . 1) + (b . 2)]) + (3 . peach) + (4 . banana)) + '(1 (2 a) 3))))) + +(ert-deftest test-data-filter-3 () + "Test the meta-convenience function -- vector structure" + (equal)) |