aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNicolas Petton2015-10-20 00:11:30 +0200
committerNicolas Petton2015-10-20 00:39:27 +0200
commit04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0 (patch)
tree2f5b54b355421705fd5dfec28bd9f88d16165e26 /test
parentb911b4b25db93c8b574a5dc6f1258893b4aa18c4 (diff)
downloademacs-04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0.tar.gz
emacs-04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0.zip
New function seq-position
* lisp/emacs-lisp/seq.el (seq-position): New function. * test/automated/seq-tests.el: New tests for seq-position. * doc/lispref/sequences.texi: Add documentation for `seq-position'.
Diffstat (limited to 'test')
-rw-r--r--test/automated/seq-tests.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el
index 7023c94c0c7..5d936828fbb 100644
--- a/test/automated/seq-tests.el
+++ b/test/automated/seq-tests.el
@@ -328,5 +328,14 @@ Evaluate BODY for each created sequence.
328 (should (eq seq (seq-into-sequence seq))) 328 (should (eq seq (seq-into-sequence seq)))
329 (should-error (seq-into-sequence 2)))) 329 (should-error (seq-into-sequence 2))))
330 330
331(ert-deftest test-seq-position ()
332 (with-test-sequences (seq '(2 4 6))
333 (should (null (seq-position seq 1)))
334 (should (= (seq-position seq 4) 1)))
335 (let ((seq '(a b c)))
336 (should (null (seq-position seq 'd #'eq)))
337 (should (= (seq-position seq 'a #'eq) 0))
338 (should (null (seq-position seq (make-symbol "a") #'eq)))))
339
331(provide 'seq-tests) 340(provide 'seq-tests)
332;;; seq-tests.el ends here 341;;; seq-tests.el ends here