emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1612d3d: Small improvement for module assertion tes


From: Glenn Morris
Subject: [Emacs-diffs] master 1612d3d: Small improvement for module assertion test
Date: Mon, 12 Jun 2017 17:17:29 -0400 (EDT)

branch: master
commit 1612d3dd78875b518ebcbcf046e6f9510ff69c99
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Small improvement for module assertion test
    
    * test/src/emacs-module-tests.el (module--test-assertions):
    Don't rely on the precise form of an "Abort" message.
---
 test/src/emacs-module-tests.el | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 99a853b..502143d 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -188,21 +188,21 @@ changes."
   ;; This doesn’t yet cause undefined behavior.
   (should (eq (mod-test-invalid-store) 123))
   (with-temp-buffer
-    (should (equal (call-process mod-test-emacs nil t nil
-                                 "-batch" "-Q" "-module-assertions" "-eval"
-                                 (prin1-to-string
-                                  `(progn
-                                     (require 'mod-test ,mod-test-file)
-                                     ;; Storing and reloading a local
-                                     ;; value causes undefined
-                                     ;; behavior, which should be
-                                     ;; detected by the module
-                                     ;; assertions.
-                                     (mod-test-invalid-store)
-                                     (mod-test-invalid-load))))
-                   ;; FIXME: This string is probably different on
-                   ;; Windows and Linux.
-                   "Abort trap: 6"))
+    ;; FIXME this dumps a core file if the user has them enabled,
+    ;; which seems unfriendly.
+    (should (string-match-p
+             "Abort" ; eg "Aborted" or "Abort trap: 6"
+             (call-process mod-test-emacs nil t nil
+                           "-batch" "-Q" "-module-assertions" "-eval"
+                           (prin1-to-string
+                            `(progn
+                               (require 'mod-test ,mod-test-file)
+                               ;; Storing and reloading a local value
+                               ;; causes undefined behavior, which should be
+                               ;; detected by the module assertions.
+                               (mod-test-invalid-store)
+                               (mod-test-invalid-load))))))
+    ;; FIXME a failure here gives an uninformative error.
     (re-search-backward (rx bos "Emacs module assertion: "
                             "Emacs value not found in "
                             (+ digit) " values of "



reply via email to

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