Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Commit

Permalink
found a bug in rep*
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-choi committed May 30, 2009
1 parent 0341221 commit a8ae2a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test_parse.clj
Expand Up @@ -157,7 +157,8 @@
"created option rule works when symbol absent")))

(deftest rep*
(let [rep*-true (p/rep* (p/lit true))]
(let [rep*-true (p/rep* (p/lit true))
rep*-untrue (p/rep* (p/except p/anything (p/lit true)))]
(is (= (rep*-true {:remainder [true "THEN"], :a 3})
[[true] {:remainder (list "THEN"), :a 3}])
"created zero-or-more-repetition rule works when symbol present singularly")
Expand All @@ -172,7 +173,10 @@
"created zero-or-more-repetition rule works with no remainder after symbols")
(is (= (rep*-true {:remainder nil})
[nil {:remainder nil}])
"created zero-or-more-repetition rule works with no remainder")))
"created zero-or-more-repetition rule works with no remainder")
(is (= (rep*-untrue {:remainder nil})
[nil {:remainder nil}])
"created zero-or-more-repetition negative rule works with no remainder")))

(deftest rep+
(let [rep+-true (p/rep+ (p/lit true))]
Expand Down

0 comments on commit a8ae2a9

Please sign in to comment.