From 05bfebfc91bc053435287f560aeb956926d31583 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 20 Dec 2015 21:59:10 +0100 Subject: [PATCH] Add check for expected backtrace in module calls. * test.el (mod-test-non-local-exit-signal-test): Compare actual backtrace to expected backtrace. --- modules/mod-test/test.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/mod-test/test.el b/modules/mod-test/test.el index 181f13208ec..caa807d3005 100644 --- a/modules/mod-test/test.el +++ b/modules/mod-test/test.el @@ -64,7 +64,21 @@ ;; (ert-deftest mod-test-non-local-exit-signal-test () - (should-error (mod-test-signal))) + (should-error (mod-test-signal)) + (let (debugger-args backtrace) + (should-error + (let ((debugger (lambda (&rest args) + (setq debugger-args args + backtrace (with-output-to-string (backtrace))) + (cl-incf num-nonmacro-input-events))) + (debug-on-signal t)) + (mod-test-signal))) + (should (equal debugger-args '(error (error . 56)))) + (should (string-match-p + (rx bol " internal--module-call(" (+ nonl) ?\) ?\n + " apply(internal--module-call " (+ nonl) ?\) ?\n + " mod-test-signal()" eol) + backtrace)))) (ert-deftest mod-test-non-local-exit-throw-test () (should (equal