diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 6 | ||||
| -rw-r--r-- | test/automated/seq-tests.el | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index b080961f681..979214c45da 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2015-02-11 Nicolas Petton <nicolas@petton.fr> | ||
| 2 | |||
| 3 | * automated/seq-tests.el (test-seq-reverse, test-seq-group-by): | ||
| 4 | Add a test for seq-reverse and update test for seq-group-by to | ||
| 5 | test vectors and strings, not only lists. | ||
| 6 | |||
| 1 | 2015-02-10 Glenn Morris <rgm@gnu.org> | 7 | 2015-02-10 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * automated/package-test.el (package-test-signed): | 9 | * automated/package-test.el (package-test-signed): |
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el index b92a15cacc5..badb3267f43 100644 --- a/test/automated/seq-tests.el +++ b/test/automated/seq-tests.el | |||
| @@ -216,10 +216,17 @@ Evaluate BODY for each created sequence. | |||
| 216 | (should (equal (seq-partition '(1 2 3) -1) '()))) | 216 | (should (equal (seq-partition '(1 2 3) -1) '()))) |
| 217 | 217 | ||
| 218 | (ert-deftest test-seq-group-by () | 218 | (ert-deftest test-seq-group-by () |
| 219 | (should (equal (seq-group-by #'test-sequences-oddp '(1 2 3 4)) | 219 | (with-test-sequences (seq '(1 2 3 4)) |
| 220 | '((t 1 3) (nil 2 4)))) | 220 | (should (equal (seq-group-by #'test-sequences-oddp seq) |
| 221 | '((t 1 3) (nil 2 4))))) | ||
| 221 | (should (equal (seq-group-by #'car '((a 1) (b 3) (c 4) (a 2))) | 222 | (should (equal (seq-group-by #'car '((a 1) (b 3) (c 4) (a 2))) |
| 222 | '((b (b 3)) (c (c 4)) (a (a 1) (a 2)))))) | 223 | '((b (b 3)) (c (c 4)) (a (a 1) (a 2)))))) |
| 223 | 224 | ||
| 225 | (ert-deftest test-seq-reverse () | ||
| 226 | (with-test-sequences (seq '(1 2 3 4)) | ||
| 227 | (should (same-contents-p (seq-reverse seq) '(4 3 2 1))) | ||
| 228 | (should (equal (type-of (seq-reverse seq)) | ||
| 229 | (type-of seq))))) | ||
| 230 | |||
| 224 | (provide 'seq-tests) | 231 | (provide 'seq-tests) |
| 225 | ;;; seq-tests.el ends here | 232 | ;;; seq-tests.el ends here |