aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/map-tests.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el
index 4dd67d48d40..9b8f17b7ca7 100644
--- a/test/lisp/emacs-lisp/map-tests.el
+++ b/test/lisp/emacs-lisp/map-tests.el
@@ -38,17 +38,19 @@ Evaluate BODY for each created map.
38\(fn (var map) body)" 38\(fn (var map) body)"
39 (declare (indent 1) (debug (symbolp body))) 39 (declare (indent 1) (debug (symbolp body)))
40 (let ((alist (make-symbol "alist")) 40 (let ((alist (make-symbol "alist"))
41 (plist (make-symbol "plist"))
41 (vec (make-symbol "vec")) 42 (vec (make-symbol "vec"))
42 (ht (make-symbol "ht"))) 43 (ht (make-symbol "ht")))
43 `(let ((,alist (list (cons 0 3) 44 `(let ((,alist (list (cons 0 3)
44 (cons 1 4) 45 (cons 1 4)
45 (cons 2 5))) 46 (cons 2 5)))
47 (,plist (list 0 3 1 4 2 5))
46 (,vec (vector 3 4 5)) 48 (,vec (vector 3 4 5))
47 (,ht (make-hash-table))) 49 (,ht (make-hash-table)))
48 (puthash 0 3 ,ht) 50 (puthash 0 3 ,ht)
49 (puthash 1 4 ,ht) 51 (puthash 1 4 ,ht)
50 (puthash 2 5 ,ht) 52 (puthash 2 5 ,ht)
51 (dolist (,var (list ,alist ,vec ,ht)) 53 (dolist (,var (list ,alist ,plist ,vec ,ht))
52 ,@body)))) 54 ,@body))))
53 55
54(ert-deftest test-map-elt () 56(ert-deftest test-map-elt ()
@@ -86,7 +88,8 @@ Evaluate BODY for each created map.
86 (with-maps-do map 88 (with-maps-do map
87 (map-put! map 2 'hello) 89 (map-put! map 2 'hello)
88 (should (eq (map-elt map 2) 'hello)) 90 (should (eq (map-elt map 2) 'hello))
89 (if (not (hash-table-p map)) 91 (if (not (or (hash-table-p map)
92 (and (listp map) (not (listp (car map)))))) ;plist!
90 (should-error (map-put! map 5 'value) 93 (should-error (map-put! map 5 'value)
91 ;; For vectors, it could arguably signal 94 ;; For vectors, it could arguably signal
92 ;; map-not-inplace as well, but it currently doesn't. 95 ;; map-not-inplace as well, but it currently doesn't.