Skip to content

Commit

Permalink
Add string tests for drop-while.
Browse files Browse the repository at this point in the history
  • Loading branch information
okamsn committed Jan 28, 2022
1 parent f259039 commit 865e595
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,14 @@
(drop-while #'cl-oddp)
(drop-while #'cl-evenp)))))))

(should (equal "de"
(eval (quote (loopy (list i '((?a ?a ?b) [?b ?c] [?c ?d ?e]))
(concat i)
(set test t (not test))
(if test
(drop-while #'cl-oddp)
(drop-while #'cl-evenp)))))))

(should (equal [4 5]
(eval (quote (loopy (list i '((1 1 2) [2 3] [3 4 5]))
(vconcat i)
Expand All @@ -3051,6 +3059,19 @@
(append coll i :at start)
(drop-while coll #'cl-oddp :at start)
(finally-return coll))))))
(should (equal "ace"
(eval (quote (loopy (accum-opt (coll start))
(list i '((?a ?b ?b) [?c ?d ?d] (?e ?f ?f)))
(concat coll i :at end)
(drop-while coll #'cl-evenp :at end)
(finally-return coll))))))

(should (equal "ffddbb"
(eval (quote (loopy (accum-opt (coll end))
(list i '((?a ?a ?b ?b) [?c ?c ?d ?d] (?e ?e ?f ?f)))
(concat coll i :at start)
(drop-while coll #'cl-oddp :at start)
(finally-return coll))))))

(should (equal [1 3 5]
(eval (quote (loopy (accum-opt (coll start))
Expand Down

0 comments on commit 865e595

Please sign in to comment.