diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 15:05:26 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 15:05:26 -0200 |
commit | d9a6666b13fb15361580354d8d865b2555d843bb (patch) | |
tree | a05080c970b9cf327285f6e3bc3cb79c4f6cf5b2 /test/test-printing.el | |
parent | fe7e31a55cdd9c25f3d0c1fba088d5499a887af9 (diff) | |
parent | 2c7e276ebcd06616362b9710ca45c2e48641adcf (diff) |
Merge branch 'master' into bind-question-sorting-to-a-key
Diffstat (limited to 'test/test-printing.el')
-rw-r--r-- | test/test-printing.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test-printing.el b/test/test-printing.el index 7384829..bcc3dd9 100644 --- a/test/test-printing.el +++ b/test/test-printing.el @@ -27,6 +27,18 @@ after being run through `sx-question--tag-format'." ;;; Tests +(ert-deftest time-since () + (cl-letf (((symbol-function #'float-time) + (lambda () 1420148997.))) + (should + (string= + "67m" + (sx-time-since 1420145000.))) + (should + (string= + "12h" + (sx-time-since 1420105000.))))) + (ert-deftest question-list-tag () "Test `sx-question--tag-format'." (should @@ -134,6 +146,17 @@ after being run through `sx-question--tag-format'." (should (equal object '((answers . [something "answer"])))))) + +;;; question-mode +(ert-deftest sx-display-question () + ;; Check it doesn't error. + (sx-display-question (elt sx-test-data-questions 0)) + ;; Check it does error. + (should-error + (sx-display-question sx-test-data-questions)) + (should-error + (sx-display-question sx-test-data-questions nil 1))) + (ert-deftest sx-question-mode--fill-and-fontify () "Check complicated questions are filled correctly." (should @@ -190,3 +213,4 @@ if you used the Stack Exchange login method, you'd... [1]: http://i.stack.imgur.com/ktFTs.png [2]: http://i.stack.imgur.com/5l2AY.png [3]: http://i.stack.imgur.com/22myl.png"))) + |