]> git.eshelyaron.com Git - emacs.git/commitdiff
Add check for expected backtrace in module calls.
authorPhilipp Stephani <phst@google.com>
Sun, 20 Dec 2015 20:59:10 +0000 (21:59 +0100)
committerPhilipp Stephani <phst@google.com>
Sun, 26 Mar 2017 20:17:34 +0000 (22:17 +0200)
* test.el (mod-test-non-local-exit-signal-test): Compare actual
  backtrace to expected backtrace.

modules/mod-test/test.el

index 181f13208ec3b321f8210ce707cc05c03a854b98..caa807d30050e5ba7f08e6541fdb6a47637b0312 100644 (file)
 ;;
 
 (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