]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix module tests on some systems
authorPhilipp Stephani <phst@google.com>
Fri, 19 May 2017 11:26:29 +0000 (13:26 +0200)
committerPhilipp Stephani <phst@google.com>
Fri, 19 May 2017 11:30:25 +0000 (13:30 +0200)
If dladdr(3) isn't available or didn't work, the printed
representation of a module function will not include the file name,
but only the address.  Make the tests pass in that case.

* test/src/emacs-module-tests.el (module-function-object): Fix match for
module function printed representation

test/src/emacs-module-tests.el

index eb7c82b2f60255c6cafc6c04a2d43f4ef0521791..0f4bfae00a2e2729290fe25648f173f58933a967 100644 (file)
@@ -78,13 +78,11 @@ changes."
       (let ((obj (nth 2 body)))
         (should (equal (type-of obj) 'module-function))
         (should (string-match-p
-                 (rx (or "#<module function Fmod_test_sum from "
-                         ;; MS-Windows doesn't allow us to get the
-                         ;; function name, only the address.
-                         (and "#<module function at 0x"
-                              (one-or-more hex-digit)
-                              " from "))
-                     (* nonl) "mod-test" (* nonl) ">")
+                 (rx "#<module function "
+                     (or "Fmod_test_sum"
+                         (and "at 0x" (+ hex-digit)))
+                     (? " from " (* nonl) "mod-test" (* nonl) )
+                     ">")
                  (prin1-to-string obj)))))))
 
 ;;