aboutsummaryrefslogtreecommitdiff
path: root/test/test-printing.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 21:11:58 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 21:11:58 -0200
commit2f0c2c3d29e24873dbe9f66718e8478ed1472ca6 (patch)
tree90ba6f290e04a75a734fb615a58ab5a2c07d3a08 /test/test-printing.el
parent9356a6a039f0d8cf8d9f31e42e8007617c58577d (diff)
parent3855607ae779165e33f5f1834bedad42d1583971 (diff)
Merge branch 'images' into print-question-without-temp-buffer
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 a6815e2..8016444 100644
--- a/test/test-printing.el
+++ b/test/test-printing.el
@@ -26,6 +26,18 @@ after being run through `sx-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-tag--format'."
(should
@@ -140,6 +152,17 @@ after being run through `sx-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
@@ -196,3 +219,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")))
+