summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-01-02 12:18:39 +0100
committerAndrea Corallo <akrl@sdf.org>2021-01-02 13:07:41 +0100
commit43d0e8483e5b51aec1347b8a2ed53acae34a9811 (patch)
tree5a3db288fdf7d3fc406e558dfc39ec1b50fc25f2 /test/src
parent03be03d36636626d4c45acd76e2f2d36be02ec8c (diff)
downloademacs-43d0e8483e5b51aec1347b8a2ed53acae34a9811.tar.gz
emacs-43d0e8483e5b51aec1347b8a2ed53acae34a9811.tar.bz2
emacs-43d0e8483e5b51aec1347b8a2ed53acae34a9811.zip
Fix `functionp' contraining (bug#45576)
* lisp/emacs-lisp/comp.el (comp-known-predicates) (comp-known-predicates-h): New constants. (comp-known-predicate-p, comp-pred-to-cstr): New functions. * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Don't define. * test/src/comp-tests.el (comp-test-45576): New testcase. * test/src/comp-test-funcs.el (comp-test-45576-f): New function.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-test-funcs.el8
-rw-r--r--test/src/comp-tests.el5
2 files changed, 13 insertions, 0 deletions
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el
index 1c2fb3d3c0b..d0ec6365819 100644
--- a/test/src/comp-test-funcs.el
+++ b/test/src/comp-test-funcs.el
@@ -455,6 +455,14 @@
(print x)
(car x)))
+(defun comp-test-45576-f ()
+ ;; Reduced from `eshell-find-alias-function'.
+ (let ((sym (intern-soft "eval")))
+ (if (and (functionp sym)
+ '(eshell-ls eshell-pred eshell-prompt eshell-script
+ eshell-term eshell-unix))
+ sym)))
+
;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests ;;
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 9801136152a..faaa2f4e4f8 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -482,6 +482,11 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
(comp-deftest comp-test-not-cons ()
(should-not (comp-test-not-cons-f nil)))
+(comp-deftest comp-test-45576 ()
+ "Functionp satisfies also symbols.
+<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-01/msg00029.html>."
+ (should (eq (comp-test-45576-f) 'eval)))
+
;;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests. ;;