summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@paredit.org>2022-11-26 10:20:45 +0000
committerTaylor R Campbell <campbell@paredit.org>2022-11-26 10:33:38 +0000
commitd82c13b5e011dc107011ab028a0b02eee50a4ad4 (patch)
tree60ffb3c7617f99f8f26cb3b2e217602b2aab0b21
parenta77a2f50060cb771dbf06674b52559f90bf9d38a (diff)
test.el: Rephrase negations in paredit-test to be less confusing.
-rw-r--r--test.el30
1 files changed, 16 insertions, 14 deletions
diff --git a/test.el b/test.el
index c0aabb2..0b5825a 100644
--- a/test.el
+++ b/test.el
@@ -57,22 +57,24 @@ Four arguments: the paredit command, the text of the buffer
(if (cond ((eq expected 'error)
;++ Check that there are no more expected states.
(condition-case condition
- (progn (call-interactively command) t)
- (error nil)))
+ (progn (call-interactively command) nil)
+ (error t)))
((stringp expected)
- (call-interactively command)
- (insert ?\|)
- (not (string= expected (buffer-string))))
- (t (error "Bad test expectation: %S" expected)))
- (progn
- (if (not xfail)
- (let ((actual (buffer-string)))
- (paredit-test-failed command before actual expected)))
- (throw 'break nil))
- (if xfail
+ (condition-case condition
+ (progn (call-interactively command)
+ (insert ?\|)
+ (string= expected (buffer-string)))
+ (error nil)))
+ (t
+ (error "Bad test expectation: %S" expected)))
+ (if xfail ;success
+ (let ((actual (buffer-string)))
+ (paredit-test-failed command before actual 'failure)
+ (throw 'break nil)))
+ (if (not xfail) ;mismatch or error
(let ((actual (buffer-string)))
- (paredit-test-failed command before actual 'failure)
- (throw 'break nil)))))
+ (paredit-test-failed command before actual expected)))
+ (throw 'break nil)))
(setq before expected))))))
(defun paredit-test-buffer-setup ()