diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/test/test/luxc/parser.lux | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/new-luxc/test/test/luxc/parser.lux b/new-luxc/test/test/luxc/parser.lux index a7708e1e5..ca980aa87 100644 --- a/new-luxc/test/test/luxc/parser.lux +++ b/new-luxc/test/test/luxc/parser.lux @@ -3,13 +3,13 @@ (lux [io] (control [monad #+ do]) (data [number] - ["R" result] + ["e" error] [text] (text format ["l" lexer]) (coll [list])) ["r" math/random "r/" Monad<Random>] - (macro [code]) + (meta [code]) test) (luxc ["&" parser])) @@ -78,10 +78,10 @@ [sample code^] (test "Can parse Lux code." (case (&;parse [default-cursor (code;to-text sample)]) - (#R;Error error) + (#e;Error error) false - (#R;Success [_ parsed]) + (#e;Success [_ parsed]) (:: code;Eq<Code> = parsed sample)) )) @@ -100,7 +100,7 @@ (%i (frac-to-int numerator)) "/" (%i (frac-to-int denominator)))]) - (#R;Success [_ [_ (#;Frac actual)]]) + (#e;Success [_ [_ (#;Frac actual)]]) (f.= expected actual) _ @@ -113,7 +113,7 @@ (test "Can parse nat char syntax." (case (&;parse [default-cursor (format "#\"" (text;from-code expected) "\"")]) - (#R;Success [_ [_ (#;Nat actual)]]) + (#e;Success [_ [_ (#;Nat actual)]]) (n.= expected actual) _ @@ -162,10 +162,10 @@ (text;from-code z))] (case (&;parse [default-cursor (format "\"" bad-match "\"")]) - (#R;Error error) + (#e;Error error) true - (#R;Success [_ parsed]) + (#e;Success [_ parsed]) false))) (test "Will accept valid multi-line text" (let [good-input (format (text;from-code x) "\n" @@ -177,36 +177,36 @@ (case (&;parse [(|> default-cursor (update@ #;column (n.+ (n.dec offset-size)))) (format "\"" good-input "\"")]) - (#R;Error error) + (#e;Error error) false - (#R;Success [_ parsed]) + (#e;Success [_ parsed]) (:: code;Eq<Code> = parsed (code;text good-output))))) (test "Can handle comments." (case (&;parse [default-cursor (format comment (code;to-text sample))]) - (#R;Error error) + (#e;Error error) false - (#R;Success [_ parsed]) + (#e;Success [_ parsed]) (:: code;Eq<Code> = parsed sample))) (test "Will reject unbalanced multi-line comments." (and (case (&;parse [default-cursor (format "#(" "#(" unbalanced-comment ")#" (code;to-text sample))]) - (#R;Error error) + (#e;Error error) true - (#R;Success [_ parsed]) + (#e;Success [_ parsed]) false) (case (&;parse [default-cursor (format "#(" unbalanced-comment ")#" ")#" (code;to-text sample))]) - (#R;Error error) + (#e;Error error) true - (#R;Success [_ parsed]) + (#e;Success [_ parsed]) false))) )) |