From 1518cee93ef2d33af9ddf214ae1c181d02c7b94f Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 1 Jan 2015 14:14:05 -0500 Subject: Add toggle for detailed test messages --- test/test-printing.el | 9 ++++++++- test/tests.el | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test-printing.el b/test/test-printing.el index 2260a00..6225bf6 100644 --- a/test/test-printing.el +++ b/test/test-printing.el @@ -7,7 +7,7 @@ `(let ((line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))) - (message "Line here is: %S" line) + (sx-test-message "Line here is: %S" line) (should (string-match ,regexp line)))) (defmacro question-list-regex (title votes answers &rest tags) @@ -27,6 +27,13 @@ after being run through `sx-question--tag-format'." ;;; Tests +(ert-deftest question-list-tag () + "Test `sx-question--tag-format'." + (should + (string= + (sx-question--tag-format "tag") + "[tag]"))) + (ert-deftest question-list-display () (cl-letf (((symbol-function #'sx-request-make) (lambda (&rest _) sx-test-data-questions))) diff --git a/test/tests.el b/test/tests.el index daaa8b5..d709600 100644 --- a/test/tests.el +++ b/test/tests.el @@ -51,5 +51,11 @@ sx-test-base-dir (symbol-name test)))) +(setq sx-test-enable-messages nil) + +(defun sx-test-message (message &rest args) + (when sx-test-enable-messages + (apply #'message (cons message args)))) + (mapc #'sx-load-test '(api macros printing util)) -- cgit v1.2.3