aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2017-10-31 00:25:32 -0400
committerEduardo Julian2017-10-31 00:25:32 -0400
commit89f165331e97d6f0814238fbc7686daac3aa4888 (patch)
tree726f27df5d1b14c926e6391013f16754ac5f8658
parente35f31c170be160b30f22eae22871eba74db2767 (diff)
- Added a test to check that can parse more than 1 Code node at once.
-rw-r--r--new-luxc/test/test/luxc/parser.lux34
1 files changed, 25 insertions, 9 deletions
diff --git a/new-luxc/test/test/luxc/parser.lux b/new-luxc/test/test/luxc/parser.lux
index 11bd98e6f..33a0bc154 100644
--- a/new-luxc/test/test/luxc/parser.lux
+++ b/new-luxc/test/test/luxc/parser.lux
@@ -76,15 +76,31 @@
(context: "Lux code parser."
(<| (times +100)
(do @
- [sample code^]
- (test "Can parse Lux code."
- (case (&;parse [default-cursor +0 (code;to-text sample)])
- (#e;Error error)
- false
-
- (#e;Success [_ parsed])
- (:: code;Eq<Code> = parsed sample))
- ))))
+ [sample code^
+ other code^]
+ ($_ seq
+ (test "Can parse Lux code."
+ (case (&;parse [default-cursor +0 (code;to-text sample)])
+ (#e;Error error)
+ false
+
+ (#e;Success [_ parsed])
+ (:: code;Eq<Code> = parsed sample)))
+ (test "Can parse Lux multiple code nodes."
+ (case (&;parse [default-cursor +0 (format (code;to-text sample) " "
+ (code;to-text other))])
+ (#e;Error error)
+ false
+
+ (#e;Success [remaining =sample])
+ (case (&;parse remaining)
+ (#e;Error error)
+ false
+
+ (#e;Success [_ =other])
+ (and (:: code;Eq<Code> = sample =sample)
+ (:: code;Eq<Code> = other =other)))))
+ ))))
(def: nat-to-frac
(-> Nat Frac)