branch: elpa/undo-fu-session
commit e43d6b3f84078d0248c55d2686bc35fd37964835
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>
Tests: update tests to exercise all cases and suppress messages
- Change (random 3) to (random 9) so all branches (0-8) are tested.
- Wrap test operations in (let ((inhibit-message t)) ...) to suppress
"Mark set" messages from kill commands
---
tests/undo-fu-session-test.el | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/tests/undo-fu-session-test.el b/tests/undo-fu-session-test.el
index ec009f9b646..52764395abc 100644
--- a/tests/undo-fu-session-test.el
+++ b/tests/undo-fu-session-test.el
@@ -66,22 +66,24 @@
(when (file-exists-p filename-session)
(delete-file filename-session))
(with-current-buffer (find-file-literally filename)
- (dotimes (_i 1000)
- (ignore-errors
- (pcase (random 3)
- (`0
- (dotimes (_j 10)
- (insert (make-string (1+ (random 20)) (+ (random 26) 65)))))
- (`1 (newline))
- (`2 (insert "\t"))
- (`3 (forward-line))
- (`4 (forward-line -1))
- (`5 (kill-line))
- (`6 (kill-paragraph -1))
- (`7 (yank))
- (`8
- (kill-region
- (+ (point-min) (random (point-max))) (+ (point-min) (random
(point-max))))))))
+ (let ((inhibit-message t))
+ (dotimes (_i 1000)
+ (ignore-errors
+ (pcase (random 9)
+ (`0
+ (dotimes (_j 10)
+ (insert (make-string (1+ (random 20)) (+ (random 26)
65)))))
+ (`1 (newline))
+ (`2 (insert "\t"))
+ (`3 (forward-line))
+ (`4 (forward-line -1))
+ (`5 (kill-line))
+ (`6 (kill-paragraph -1))
+ (`7 (yank))
+ (`8
+ (kill-region
+ (+ (point-min) (random (point-max)))
+ (+ (point-min) (random (point-max)))))))))
(save-buffer)
(undo-fu-session-save)
(kill-buffer (current-buffer)))