summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2015-12-20 21:59:10 +0100
committerPhilipp Stephani <phst@google.com>2017-03-26 22:17:34 +0200
commit05bfebfc91bc053435287f560aeb956926d31583 (patch)
tree461b2b424c19d17e4471aac335a442eecc619093 /modules
parenta749b55d8ee530797ccff693ad302541257d0415 (diff)
downloademacs-05bfebfc91bc053435287f560aeb956926d31583.tar.gz
Add check for expected backtrace in module calls.
* test.el (mod-test-non-local-exit-signal-test): Compare actual backtrace to expected backtrace.
Diffstat (limited to 'modules')
-rw-r--r--modules/mod-test/test.el16
1 files changed, 15 insertions, 1 deletions
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