diff options
| author | Andrea Corallo | 2021-01-04 22:04:29 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-01-04 22:31:40 +0100 |
| commit | 5074447ef4980e2eb613e908e346fd3471f52139 (patch) | |
| tree | c6d1f26b0527843bd85053e443567c6552988a76 /test | |
| parent | a3f2373bfb604af5570c86b4ffefb23296a5bfdd (diff) | |
| download | emacs-5074447ef4980e2eb613e908e346fd3471f52139.tar.gz emacs-5074447ef4980e2eb613e908e346fd3471f52139.zip | |
Fix type inference for bug#45635
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix
missing mixed pos neg handling.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
* test/src/comp-tests.el (45635): New testcase.
* test/src/comp-test-funcs.el (comp-test-45635-f): New function.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/comp-cstr-tests.el | 4 | ||||
| -rw-r--r-- | test/src/comp-test-funcs.el | 15 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 5 |
3 files changed, 23 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el b/test/lisp/emacs-lisp/comp-cstr-tests.el index 1e1376b363b..149afaf85d8 100644 --- a/test/lisp/emacs-lisp/comp-cstr-tests.el +++ b/test/lisp/emacs-lisp/comp-cstr-tests.el | |||
| @@ -207,7 +207,9 @@ | |||
| 207 | ;; 83 | 207 | ;; 83 |
| 208 | ((not t) . nil) | 208 | ((not t) . nil) |
| 209 | ;; 84 | 209 | ;; 84 |
| 210 | ((not nil) . t)) | 210 | ((not nil) . t) |
| 211 | ;; 85 | ||
| 212 | ((or (not string) t) . t)) | ||
| 211 | "Alist type specifier -> expected type specifier.")) | 213 | "Alist type specifier -> expected type specifier.")) |
| 212 | 214 | ||
| 213 | (defmacro comp-cstr-synthesize-tests () | 215 | (defmacro comp-cstr-synthesize-tests () |
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el index d0ec6365819..694d9d426d5 100644 --- a/test/src/comp-test-funcs.el +++ b/test/src/comp-test-funcs.el | |||
| @@ -463,6 +463,21 @@ | |||
| 463 | eshell-term eshell-unix)) | 463 | eshell-term eshell-unix)) |
| 464 | sym))) | 464 | sym))) |
| 465 | 465 | ||
| 466 | (defun comp-test-45635-f (&rest args) | ||
| 467 | ;; Reduced from `set-face-attribute'. | ||
| 468 | (let ((spec args) | ||
| 469 | family) | ||
| 470 | (while spec | ||
| 471 | (cond ((eq (car spec) :family) | ||
| 472 | (setq family (cadr spec)))) | ||
| 473 | (setq spec (cddr spec))) | ||
| 474 | (when (and (stringp family) | ||
| 475 | (string-match "\\([^-]*\\)-\\([^-]*\\)" family)) | ||
| 476 | (setq family (match-string 2 family))) | ||
| 477 | (when (or (stringp family) | ||
| 478 | (eq family 'unspecified)) | ||
| 479 | family))) | ||
| 480 | |||
| 466 | 481 | ||
| 467 | ;;;;;;;;;;;;;;;;;;;; | 482 | ;;;;;;;;;;;;;;;;;;;; |
| 468 | ;; Tromey's tests ;; | 483 | ;; Tromey's tests ;; |
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index faaa2f4e4f8..23a108796b8 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -487,6 +487,11 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." | |||
| 487 | <https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-01/msg00029.html>." | 487 | <https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-01/msg00029.html>." |
| 488 | (should (eq (comp-test-45576-f) 'eval))) | 488 | (should (eq (comp-test-45576-f) 'eval))) |
| 489 | 489 | ||
| 490 | (comp-deftest 45635-1 () | ||
| 491 | "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-01/msg00158.html>." | ||
| 492 | (should (string= (comp-test-45635-f :height 180 :family "PragmataPro Liga") | ||
| 493 | "PragmataPro Liga"))) | ||
| 494 | |||
| 490 | 495 | ||
| 491 | ;;;;;;;;;;;;;;;;;;;;; | 496 | ;;;;;;;;;;;;;;;;;;;;; |
| 492 | ;; Tromey's tests. ;; | 497 | ;; Tromey's tests. ;; |