summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNicolas Petton <nicolas@petton.fr>2015-08-14 22:33:10 +0200
committerNicolas Petton <nicolas@petton.fr>2015-08-23 19:50:26 +0200
commite7be9861962a5a399047e86a254c2534d5d4d146 (patch)
treed34e43a6223522794a55aecedccffdc1769896f1 /test
parent58c3762a8b8cfcf714539bda7114f52b6f615258 (diff)
downloademacs-e7be9861962a5a399047e86a254c2534d5d4d146.tar.gz
Make seq.el more extensible by using cl-defmethod
* lisp/emacs-lisp/seq.el: Define seq.el functions using cl-defmethod to make it easier to extend seq.el with new "seq types". * test/automated/seq-tests.el (test-setf-seq-elt): New test. * lisp/emacs-lisp/cl-extra.el (cl-subseq): Move back the definition of subseq in cl-extra.el, and use it in seq.el.
Diffstat (limited to 'test')
-rw-r--r--test/automated/seq-tests.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el
index 74c0700759e..163935b5432 100644
--- a/test/automated/seq-tests.el
+++ b/test/automated/seq-tests.el
@@ -54,6 +54,11 @@ Evaluate BODY for each created sequence.
"Return t if INTEGER is odd."
(not (test-sequences-evenp integer)))
+(ert-deftest test-setf-seq-elt ()
+ (with-test-sequences (seq '(1 2 3))
+ (setf (seq-elt seq 1) 4)
+ (should (= 4 (seq-elt seq 1)))))
+
(ert-deftest test-seq-drop ()
(with-test-sequences (seq '(1 2 3 4))
(should (equal (seq-drop seq 0) seq))
@@ -192,7 +197,7 @@ Evaluate BODY for each created sequence.
(should-error (seq-subseq [] -1))
(should-error (seq-subseq "" -1))
(should-not (seq-subseq '() 0))
- (should-error(seq-subseq '() 0 -1)))
+ (should-error (seq-subseq '() 0 -1)))
(ert-deftest test-seq-concatenate ()
(with-test-sequences (seq '(2 4 6))