summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2021-04-06 15:12:20 +0200
committerbrotzeit <brotzeitmacher@gmail.com>2021-04-23 13:57:07 +0200
commit09b4320f96671acf4e04aa316a4f5340cc18388a (patch)
tree8375c1f337e78cf5c812fb6580292502eb4808dc /rust-mode-tests.el
parent4e394ac993c23b459f658639c4835378adf5da97 (diff)
downloadrust-mode-09b4320f96671acf4e04aa316a4f5340cc18388a.tar.gz
test: Suppress some noisy messages
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 56ed369..9c23ed4 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -9,6 +9,15 @@
(defconst rust-test-fill-column 32)
(setq-default indent-tabs-mode nil)
+(defmacro test-silence (messages &rest body)
+ `(cl-letf* (((symbol-function 'm)
+ (symbol-function #'message))
+ ((symbol-function #'message)
+ (lambda (format-string &rest args)
+ (unless (member format-string ,messages)
+ (apply 'm format-string args)))))
+ ,@body))
+
(defun rust-compare-code-after-manip (_original _point-pos _manip-func expected got)
(equal expected got))
@@ -309,7 +318,10 @@ very very very long string
deindented
1
(lambda ()
- (indent-region 1 (+ 1 (buffer-size))))
+ (test-silence
+ '("%s %s" ; "Indenting..." progress-reporter-do-update
+ "%sdone") ; "Indenting...done" progress-reporter-done
+ (indent-region 1 (+ 1 (buffer-size)))))
indented)))