summaryrefslogtreecommitdiff
path: root/test.el
diff options
context:
space:
mode:
Diffstat (limited to 'test.el')
-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 ()