summaryrefslogtreecommitdiff
path: root/test/src/emacs-module-tests.el
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-06-04 18:57:51 +0200
committerPhilipp Stephani <phst@google.com>2017-06-04 19:50:49 +0200
commit3b0080de52db1756fc47f1642ee9980655421af9 (patch)
tree5d2a765a0ef67144461de82fbc4043a9cb5de378 /test/src/emacs-module-tests.el
parent18396997b30c053a905c9a509777625ccc01c3d5 (diff)
downloademacs-3b0080de52db1756fc47f1642ee9980655421af9.tar.gz
emacs-3b0080de52db1756fc47f1642ee9980655421af9.tar.bz2
emacs-3b0080de52db1756fc47f1642ee9980655421af9.zip
Rework printing of module functions
Fix a FIXME in emacs-module.c. Put the printing into print.c, like other types. * src/print.c (print_vectorlike): Add code to print module functions. * src/emacs-module.c (funcall_module): Stop calling 'module_format_fun_env'. Now that module functions are first-class objects, they can be added to signal data directly. (module_handle_signal): Remove now-unused function 'module_format_fun_env'. * test/src/emacs-module-tests.el (mod-test-sum-test): Adapt unit test. * src/eval.c (funcall_lambda): Adapt call to changed signature of 'funcall_module'.
Diffstat (limited to 'test/src/emacs-module-tests.el')
-rw-r--r--test/src/emacs-module-tests.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 5e78aebf7c3..622bbadb3ef 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -31,13 +31,13 @@
(should (= (mod-test-sum 1 2) 3))
(let ((descr (should-error (mod-test-sum 1 2 3))))
(should (eq (car descr) 'wrong-number-of-arguments))
- (should (stringp (nth 1 descr)))
+ (should (module-function-p (nth 1 descr)))
(should (eq 0
(string-match
(concat "#<module function "
"\\(at \\(0x\\)?[0-9a-fA-F]+\\( from .*\\)?"
"\\|Fmod_test_sum from .*\\)>")
- (nth 1 descr))))
+ (prin1-to-string (nth 1 descr)))))
(should (= (nth 2 descr) 3)))
(should-error (mod-test-sum "1" 2) :type 'wrong-type-argument)
(should-error (mod-test-sum 1 "2") :type 'wrong-type-argument)