aboutsummaryrefslogtreecommitdiff
path: root/test/test-printing.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 15:06:19 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 15:06:19 -0200
commitc8c187dd61bde903ddaa666d92b3a66648d1d42b (patch)
tree78e0fb53d89db30ad4150a85b7ee1837613be488 /test/test-printing.el
parent680741fbb56b09fc1ffb842bc22cafab92a01501 (diff)
parent2c7e276ebcd06616362b9710ca45c2e48641adcf (diff)
Merge branch 'master' into more-ordering
Diffstat (limited to 'test/test-printing.el')
-rw-r--r--test/test-printing.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test-printing.el b/test/test-printing.el
index e6f5c3a..6fa77b9 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
@@ -135,6 +147,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
@@ -191,3 +214,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")))
+