aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Stephani2018-02-02 20:40:10 +0100
committerPhilipp Stephani2018-02-02 20:40:10 +0100
commit75c663f834528c5431973bf8dc6386c327f9fe0f (patch)
tree5a8fe1fedb7a7fc19e6f2b5b02bfc5e282426de4
parentf3d0db7f0f9639ec0198d4f4f2c3eb9c7b495778 (diff)
downloademacs-75c663f834528c5431973bf8dc6386c327f9fe0f.tar.gz
emacs-75c663f834528c5431973bf8dc6386c327f9fe0f.zip
Use 'defalias' in test module instead of 'fset'.
This puts functions defined in the module into the 'load-history'. * test/data/emacs-module/mod-test.c (bind_function): Use 'defalias' instead of 'fset'. * test/src/emacs-module-tests.el (module/describe-function-1): Adapt unit test.
-rw-r--r--test/data/emacs-module/mod-test.c4
-rw-r--r--test/src/emacs-module-tests.el5
2 files changed, 5 insertions, 4 deletions
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c
index a1c115f00d2..db05e90bc49 100644
--- a/test/data/emacs-module/mod-test.c
+++ b/test/data/emacs-module/mod-test.c
@@ -299,11 +299,11 @@ provide (emacs_env *env, const char *feature)
299static void 299static void
300bind_function (emacs_env *env, const char *name, emacs_value Sfun) 300bind_function (emacs_env *env, const char *name, emacs_value Sfun)
301{ 301{
302 emacs_value Qfset = env->intern (env, "fset"); 302 emacs_value Qdefalias = env->intern (env, "defalias");
303 emacs_value Qsym = env->intern (env, name); 303 emacs_value Qsym = env->intern (env, name);
304 emacs_value args[] = { Qsym, Sfun }; 304 emacs_value args[] = { Qsym, Sfun };
305 305
306 env->funcall (env, Qfset, 2, args); 306 env->funcall (env, Qdefalias, 2, args);
307} 307}
308 308
309/* Module init function. */ 309/* Module init function. */
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 05be8383dcc..052f5c2f12c 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -268,8 +268,9 @@ during garbage collection."
268 (let ((standard-output (current-buffer))) 268 (let ((standard-output (current-buffer)))
269 (describe-function-1 #'mod-test-sum) 269 (describe-function-1 #'mod-test-sum)
270 (should (equal (buffer-substring-no-properties 1 (point-max)) 270 (should (equal (buffer-substring-no-properties 1 (point-max))
271 ;; FIXME: This should print the filename. 271 ;; FIXME: This should print the actual module
272 "a module function. 272 ;; filename.
273 "a module function in `src/emacs-module-tests.el'.
273 274
274(mod-test-sum a b) 275(mod-test-sum a b)
275 276