diff options
| author | Nicolas Petton | 2015-05-05 22:10:32 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2015-05-05 22:10:32 +0200 |
| commit | 4ac426a1b90912ea947d46a57b6fcbbbf7586da1 (patch) | |
| tree | bbf748a53aca52aeac72df288e9cfbac3b951580 /test | |
| parent | 0508aa26705b3507d9afac54ada4eac47f8cf8a5 (diff) | |
| parent | 8cb4b4f98aa2758a016df25e39ff48cf132ed39c (diff) | |
| download | emacs-4ac426a1b90912ea947d46a57b6fcbbbf7586da1.tar.gz emacs-4ac426a1b90912ea947d46a57b6fcbbbf7586da1.zip | |
Merge branch 'seq-let'
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/seq-tests.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el index 7f6e06cc4b6..ab46eb85f76 100644 --- a/test/automated/seq-tests.el +++ b/test/automated/seq-tests.el | |||
| @@ -276,5 +276,26 @@ Evaluate BODY for each created sequence. | |||
| 276 | (v2 [2 4 6])) | 276 | (v2 [2 4 6])) |
| 277 | (should (seq-empty-p (seq-difference v1 v2))))) | 277 | (should (seq-empty-p (seq-difference v1 v2))))) |
| 278 | 278 | ||
| 279 | (ert-deftest test-seq-let () | ||
| 280 | (with-test-sequences (seq '(1 2 3 4)) | ||
| 281 | (seq-let (a b c d e) seq | ||
| 282 | (should (= a 1)) | ||
| 283 | (should (= b 2)) | ||
| 284 | (should (= c 3)) | ||
| 285 | (should (= d 4)) | ||
| 286 | (should (null e))) | ||
| 287 | (seq-let (a b &rest others) seq | ||
| 288 | (should (= a 1)) | ||
| 289 | (should (= b 2)) | ||
| 290 | (should (same-contents-p others (seq-drop seq 2))))) | ||
| 291 | (let ((seq '(1 (2 (3 (4)))))) | ||
| 292 | (seq-let (_ (_ (_ (a)))) seq | ||
| 293 | (should (= a 4)))) | ||
| 294 | (let (seq) | ||
| 295 | (seq-let (a b c) seq | ||
| 296 | (should (null a)) | ||
| 297 | (should (null b)) | ||
| 298 | (should (null c))))) | ||
| 299 | |||
| 279 | (provide 'seq-tests) | 300 | (provide 'seq-tests) |
| 280 | ;;; seq-tests.el ends here | 301 | ;;; seq-tests.el ends here |