]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix test when running from test/lisp/subr-tests.elc
authorNoam Postavsky <npostavs@gmail.com>
Sat, 15 Jul 2017 16:12:17 +0000 (12:12 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sun, 16 Jul 2017 01:55:29 +0000 (21:55 -0400)
* test/lisp/subr-tests.el (subr-test-backtrace-simple-tests): Don't
assume a lambda expression will be `equal' to its quoted form.  That's
not true if the lambda expression has been compiled.

test/lisp/subr-tests.el

index 54f4ab5d1b2ca34bc685c16bdbc0f51a62df4314..7e50429a5bf0e45d53d65238a160ec5063a279de 100644 (file)
@@ -258,9 +258,9 @@ This exercises `backtrace-frame', and indirectly `mapbacktrace'."
     (should (equal (mapbacktrace #'error unbound) nil)))
   ;; First frame is backtrace-related function
   (should (equal (backtrace-frame 0) '(t backtrace-frame 0)))
-  (should (equal (catch 'ret
-                   (mapbacktrace (lambda (&rest args) (throw 'ret args))))
-                 '(t mapbacktrace ((lambda (&rest args) (throw 'ret args))) nil)))
+  (let ((throw-args (lambda (&rest args) (throw 'ret args))))
+    (should (equal (catch 'ret (mapbacktrace throw-args))
+                   `(t mapbacktrace (,throw-args) nil))))
   ;; Past-end NFRAMES is silently ignored
   (should (equal (backtrace-frame most-positive-fixnum) nil)))