From d88043944057c4b8ab4a6e37d8f8f80be4a15049 Mon Sep 17 00:00:00 2001 From: Ola Nilsson Date: Fri, 23 Aug 2024 00:05:13 +0200 Subject: [PATCH] tests: Cleanup and comments --- tests/test-buttercup.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el index 9b3cd68..2c3ddc8 100644 --- a/tests/test-buttercup.el +++ b/tests/test-buttercup.el @@ -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) @@ -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) @@ -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