Skip to content

Commit

Permalink
tests: Cleanup and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
snogge committed Aug 22, 2024
1 parent 4e8db2c commit d880439
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test-buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ before it's processed by other functions."
(kill-buffer print-buffer)
(setq print-buffer nil))
;; define a buttercup-reporter-batch variant that only outputs on
;; buttercup-done
;; buttercup-done, because that is where backtraces are printed
(before-each
(spy-on 'backtrace-reporter :and-call-fake
(lambda (event arg)
Expand All @@ -1960,11 +1960,12 @@ before it's processed by other functions."
(spy-on 'buttercup-reporter-batch--print-summary))
;; define a known backtrace with a typical error
(before-all
(defun bc-bt-foo (a) (bc-bt-bar a))
(defun bc-bt-bar (a) (bc-bt-baz a))
(defun bc-bt-baz (a)
(defun bc-bt-baz (a)
(or (number-or-marker-p a)
(signal 'wrong-type-argument `(number-or-marker-p ,a)))))
(signal 'wrong-type-argument `(number-or-marker-p ,a))))
(with-no-warnings
(defun bc-bt-bar (a) (bc-bt-baz a))
(defun bc-bt-foo (a) (bc-bt-bar a))))
(after-all
(fmakunbound 'bc-bt-foo)
(fmakunbound 'bc-bt-bar)
Expand Down Expand Up @@ -2012,6 +2013,8 @@ before it's processed by other functions."
(bc-bt-foo long-string)
:to-be-truthy)))
(setq test-suites buttercup-suites)))
(after-each
(setq test-suites nil))
(it "`crop' should print truncated lines"
(with-local-buttercup
:suites test-suites :reporter #'backtrace-reporter
Expand Down

0 comments on commit d880439

Please sign in to comment.