]> git.eshelyaron.com Git - emacs.git/commitdiff
Give a more informative failure in module assertion test
authorGlenn Morris <rgm@gnu.org>
Mon, 12 Jun 2017 21:37:30 +0000 (17:37 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 12 Jun 2017 21:37:55 +0000 (17:37 -0400)
* test/src/emacs-module-tests.el (module--test-assertions):
Rephrase final check to give a more informative failure.

test/src/emacs-module-tests.el

index aea0bba540b2ed310cb4bd4c9551c4a63b1255c4..a4994b6223b43590245918010c44a1ac0fa035f8 100644 (file)
@@ -205,11 +205,14 @@ changes."
                                        ;; 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 "
-                                  (+ digit) " environments" ?\n eos)))
+          (search-backward "Emacs module assertion:")
+          (should (string-match-p (rx bos "Emacs module assertion: "
+                                      "Emacs value not found in "
+                                      (+ digit) " values of "
+                                      (+ digit) " environments" eos)
+                                  (buffer-substring-no-properties
+                                   (line-beginning-position)
+                                   (line-end-position)))))
       (delete-directory tempdir t))))
 
 ;;; emacs-module-tests.el ends here