Permalink
Browse files

Add tests for except?.

  • Loading branch information...
Ramarren committed Mar 28, 2012
1 parent c12c799 commit ddbdbbeadff9e9f588a4f27e97ac3567e8490357
Showing with 8 additions and 0 deletions.
  1. +8 −0 test-parsers.lisp
View
@@ -308,6 +308,14 @@
("12345" '(#\1 #\2 #\3 #\4 #\5))
("1234" "123456"))
+(defparsertest test-except? (except? (many* (item)) "a")
+ ("123" '(#\1 #\2 #\3) "cba" '(#\c #\b #\a))
+ ("abc"))
+
+(defparsertest test-except?2 (except? (gather-before-token* #\; :accept-empty t :accept-end t) (end?))
+ ("123;" '(#\1 #\2 #\3) ";" nil "123" '(#\1 #\2 #\3))
+ (""))
+
(defparsertest test-opt? (named-seq? (<- a "a") (<- b (opt? "b")) (<- c "c") (list a b c))
("abc" '(#\a #\b #\c) "ac" '(#\a nil #\c))
("abbc" "aabc"))

0 comments on commit ddbdbbe

Please sign in to comment.