From 3b0080de52db1756fc47f1642ee9980655421af9 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 4 Jun 2017 18:57:51 +0200 Subject: 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'. --- test/src/emacs-module-tests.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') 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 "#") - (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) -- cgit v1.2.1 From 98e107ff0ca39027420a2ea100037402d23a0ea0 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Mon, 5 Jun 2017 10:04:20 +0200 Subject: Add missing dependency to test module source file --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/Makefile.in b/test/Makefile.in index 4f12a8ea48c..7b8c967128f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -182,7 +182,7 @@ test_module_dir := $(srcdir)/data/emacs-module test_module_name := mod-test@MODULES_SUFFIX@ test_module := $(test_module_dir)/$(test_module_name) $(srcdir)/src/emacs-module-tests.log: $(test_module) -$(test_module): $(srcdir)/../src/emacs-module.[ch] +$(test_module): $(srcdir)/../src/emacs-module.[ch] $(test_module_dir)/mod-test.c $(MAKE) -C $(test_module_dir) $(test_module_name) SO=@MODULES_SUFFIX@ endif -- cgit v1.2.1