aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/control/parser/cli.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-07-02 23:36:02 -0400
committerEduardo Julian2019-07-02 23:36:02 -0400
commit91c0619657bcf2ac520e7dd2912188f66bbe2157 (patch)
treef26675f263eb5f0285c1674b0777a7369248fe07 /stdlib/source/test/lux/control/parser/cli.lux
parent4f191540f831a7bba0e262b1a6b598f99fb9b35c (diff)
Re-name "lux/data/error" to "lux/control/try".
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/control/parser/cli.lux26
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux
index 5c87513d4..b304a2ab2 100644
--- a/stdlib/source/test/lux/control/parser/cli.lux
+++ b/stdlib/source/test/lux/control/parser/cli.lux
@@ -7,9 +7,9 @@
["r" math/random]
[control
pipe
+ ["." try]
["p" parser]]
[data
- ["." error]
[number
["." nat ("#@." decimal)]]
["." text ("#@." equivalence)]
@@ -33,44 +33,44 @@
($_ _.and
(_.test "Can read any argument."
(|> (/.run /.any (list yes))
- (case> (#error.Failure _)
+ (case> (#try.Failure _)
#0
- (#error.Success arg)
+ (#try.Success arg)
(text@= arg yes))))
(_.test "Can test tokens."
(and (|> (/.run (/.this yes) (list yes))
- (case> (#error.Failure _)
+ (case> (#try.Failure _)
#0
- (#error.Success _)
+ (#try.Success _)
#1))
(|> (/.run (/.this yes) (list no))
- (case> (#error.Failure _)
+ (case> (#try.Failure _)
#1
- (#error.Success _)
+ (#try.Success _)
#0))))
(_.test "Can use custom token parsers."
(|> (/.run (/.parse nat@decode) (list yes))
- (case> (#error.Failure _)
+ (case> (#try.Failure _)
#0
- (#error.Success parsed)
+ (#try.Success parsed)
(text@= (nat@encode parsed)
yes))))
(_.test "Can query if there are any more inputs."
(and (|> (/.run /.end (list))
- (case> (#error.Success []) #1 _ #0))
+ (case> (#try.Success []) #1 _ #0))
(|> (/.run (p.not /.end) (list yes))
- (case> (#error.Success []) #0 _ #1))))
+ (case> (#try.Success []) #0 _ #1))))
(_.test "Can parse CLI input anywhere."
(|> (/.run (|> (/.somewhere (/.this yes))
(p.before (p.some /.any)))
(list.concat (list pre-ignore (list yes) post-ignore)))
- (case> (#error.Failure _)
+ (case> (#try.Failure _)
#0
- (#error.Success _)
+ (#try.Success _)
#1)))
))))