Commits

Anonymous committed a2086af

Add test for maybe combinator

  • Participants
  • Parent commits 6a1c84a

Comments (0)

Files changed (1)

 (test-group "sequence"
   (test-parse* "ab" (sequence (is #\a) (is #\b)) "abc"))
 
+(test-group "maybe"
+  (let ((foo (preceded-by (maybe (is #\x)) (char-seq "foo"))))
+    (test-parse* "foo" foo "foo")
+    (test-parse* "foo" foo "xfoo")))
+
 (test-group "repeated"
   (test-parse* "hohoho" (repeated (char-seq "ho")) "hohoho")
   (test-parse* "ho    ho ho "