aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2020-09-21 16:58:46 +0100
committerJoão Távora2020-09-21 17:01:08 +0100
commitd8d196cf9eb283299eabaf70706d0e86adff03d6 (patch)
tree0ca9ce784cdc0c91c8552f58bdd91c756e034e60
parentea9544dac5ceb27451d1b7142a785410cf811925 (diff)
downloademacs-scratch/shorthand-namespacing.tar.gz
emacs-scratch/shorthand-namespacing.zip
Add a test for byte-compilationscratch/shorthand-namespacing
* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-byte-compile-a-file): New test. (elisp-shorthand-load-a-file): Simplify.
-rw-r--r--test/lisp/progmodes/elisp-mode-tests.el26
1 files changed, 23 insertions, 3 deletions
diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el
index dee043bd3ec..9621ab33c37 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -843,9 +843,29 @@ to (xref-elisp-test-descr-to-target xref)."
843 (error "this file needs to be loaded"))))) 843 (error "this file needs to be loaded")))))
844 844
845(ert-deftest elisp-shorthand-load-a-file () 845(ert-deftest elisp-shorthand-load-a-file ()
846 (let ((load-path (cons elisp--test-resources-dir 846 (let ((test-file (expand-file-name "simple-shorthand-test.el"
847 load-path))) 847 elisp--test-resources-dir)))
848 (load "simple-shorthand-test") 848 (mapatoms (lambda (s)
849 (when (string-match "^elisp--foo-" (symbol-name s))
850 (unintern s obarray))))
851 (load test-file)
852 (should (intern-soft "elisp--foo-test"))
853 (should-not (intern-soft "f-test"))))
854
855(ert-deftest elisp-shorthand-byte-compile-a-file ()
856
857 (let ((test-file (expand-file-name "simple-shorthand-test.el"
858 elisp--test-resources-dir))
859 (byte-compiled (expand-file-name "simple-shorthand-test.elc"
860 elisp--test-resources-dir)))
861 (mapatoms (lambda (s)
862 (when (string-match "^elisp--foo-" (symbol-name s))
863 (unintern s obarray))))
864 (byte-compile-file test-file)
865 (should-not (intern-soft "f-test"))
866 (should (intern-soft "elisp--foo-test"))
867 (should-not (fboundp (intern-soft "elisp--foo-test")))
868 (load byte-compiled)
849 (should (intern-soft "elisp--foo-test")) 869 (should (intern-soft "elisp--foo-test"))
850 (should-not (intern-soft "f-test")))) 870 (should-not (intern-soft "f-test"))))
851 871