diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-12-02 22:47:00 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-12-05 19:01:03 +0100 |
commit | 7c1d90a41df8792f7311f0ec5a33c613f08ac4ae (patch) | |
tree | 6b5c662061ab7b0f5579eb17db8d64143b0d5cee /test/lisp/emacs-lisp | |
parent | 1fb249f6db1ae87ee3ddd221ab9c8d152951efe7 (diff) | |
download | emacs-7c1d90a41df8792f7311f0ec5a33c613f08ac4ae.tar.gz emacs-7c1d90a41df8792f7311f0ec5a33c613f08ac4ae.tar.bz2 emacs-7c1d90a41df8792f7311f0ec5a33c613f08ac4ae.zip |
Initial support for union of negated constraints
* lisp/emacs-lisp/comp-cstr.el (comp-range-negation): New
function.
(comp-cstr-union-homogeneous-no-range): Rename from
`comp-cstr-union-no-range'.
(comp-cstr-union-homogeneous): Rename from `comp-cstr-union'.
(comp-cstr-union-1): New function.
(comp-cstr-union-no-range, comp-cstr-union): Rewrite in function
of `comp-cstr-union-1'.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a bunch of tests.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/comp-cstr-tests.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el b/test/lisp/emacs-lisp/comp-cstr-tests.el index 541533601b1..5c119c6ba3e 100644 --- a/test/lisp/emacs-lisp/comp-cstr-tests.el +++ b/test/lisp/emacs-lisp/comp-cstr-tests.el @@ -78,7 +78,14 @@ ((and (integer -1 3) (integer 3 5)) . (integer 3 3)) ((and (integer -1 4) (integer 3 5)) . (integer 3 4)) ((and (integer -1 5) nil) . nil) - ((not symbol) . (not symbol))) + ((not symbol) . (not symbol)) + ((or (member foo) (not (member foo bar))) . (not (member bar))) + ((or (member foo bar) (not (member foo))) . t) + ;; Intentionally conservative, see `comp-cstr-union'. + ((or symbol (not sequence)) . t) + ((or vector (not sequence)) . (not sequence)) + ((or (integer 1 10) (not (integer * 5))) . (integer 1 *)) + ((or symbol (integer 1 10) (not (integer * 5))) . (integer 1 *))) "Alist type specifier -> expected type specifier.") (defmacro comp-cstr-synthesize-tests () |