emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 05bfebf: Add check for expected backtrace in module


From: Philipp Stephani
Subject: [Emacs-diffs] master 05bfebf: Add check for expected backtrace in module calls.
Date: Sun, 26 Mar 2017 16:17:58 -0400 (EDT)

branch: master
commit 05bfebfc91bc053435287f560aeb956926d31583
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    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 181f132..caa807d 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]