diff options
author | Eduardo Julian | 2017-10-31 00:25:32 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-31 00:25:32 -0400 |
commit | 89f165331e97d6f0814238fbc7686daac3aa4888 (patch) | |
tree | 726f27df5d1b14c926e6391013f16754ac5f8658 /new-luxc | |
parent | e35f31c170be160b30f22eae22871eba74db2767 (diff) |
- Added a test to check that can parse more than 1 Code node at once.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/test/test/luxc/parser.lux | 34 |
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) |