diff options
author | Sean Allred <code@seanallred.com> | 2014-11-01 13:07:11 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-01 13:07:11 -0400 |
commit | a5d8a8e409c7ccaa92ed313ce9d1c8f27ebab1c3 (patch) | |
tree | 310014aa6bf110a5e58b423d1c77a70f0e80e03d /test/tests.el | |
parent | a8e1a143701326da47f973d3ad6062919e614e31 (diff) |
Move tests and sample data to test/
Diffstat (limited to 'test/tests.el')
-rw-r--r-- | test/tests.el | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/tests.el b/test/tests.el new file mode 100644 index 0000000..e8452af --- /dev/null +++ b/test/tests.el @@ -0,0 +1,55 @@ +(defun -stack--nuke () + (interactive) + (mapatoms + (lambda (symbol) + (if (string-prefix-p "stack-" (symbol-name symbol)) + (unintern symbol))))) + +;;; Tests + +(setq stack-core-remaining-api-requests-message-threshold 50000) +(setq debug-on-error t) + +(require 'stack-core) +(require 'stack-question) + +(ert-deftest test-basic-request () + "Test basic request functionality" + (should (stack-core-make-request "sites"))) + +(ert-deftest test-question-retrieve () + "Test the ability to receive a list of questions." + (should (stack-question-get-questions 'emacs))) + +(ert-deftest test-bad-request () + "Test a method given a bad set of keywords" + (should-error + (stack-core-make-request "questions" '(())))) + +(ert-deftest test-data-filter-1 () + "Test the meta-convenience function -- flat structure" + (should + (equal + '((1 . t) (2 . [1 2]) (3)) + (stack-core-filter-data '((0 . 3) + (1 . t) + (a . five) + (2 . [1 2]) + ("5" . bop) + (3) + (p . 4)) + '(1 2 3))))) + +(ert-deftest test-data-filter-2 () + "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))))) |