aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test-printing.el12
-rw-r--r--test/tests.el16
2 files changed, 28 insertions, 0 deletions
diff --git a/test/test-printing.el b/test/test-printing.el
index 2857cb7..29c209d 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
diff --git a/test/tests.el b/test/tests.el
index ce42a9f..5eec57c 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -60,3 +60,19 @@
(mapc #'sx-load-test
'(api macros printing util search))
+
+(ert-deftest user-entry-functions ()
+ "Ensures all entry functions are autoloaded."
+ (should
+ (cl-every
+ #'fboundp
+ '(sx-ask
+ sx-authenticate
+ sx-bug-report
+ sx-tab-frontpage
+ sx-tab-hot
+ sx-tab-month
+ sx-tab-newest
+ sx-tab-topvoted
+ sx-tab-week
+ sx-version))))