aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/control/parser/cli.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-04-19 18:49:43 -0400
committerEduardo Julian2019-04-19 18:49:43 -0400
commit6d4950f84e4ec1d35dff95c9816d75f360d4a349 (patch)
treef48b6d793b4175316c5636878479dc348fae0394 /stdlib/source/test/lux/control/parser/cli.lux
parent0ed7cb3a7d07cf92be57a8f26355212bcee0325d (diff)
Moved the CLI parser under "lux/control/parser/".
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/control/parser/cli.lux (renamed from stdlib/source/test/lux/control/cli.lux)20
1 files changed, 11 insertions, 9 deletions
diff --git a/stdlib/source/test/lux/control/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux
index ff7a3abb3..a476c97c6 100644
--- a/stdlib/source/test/lux/control/cli.lux
+++ b/stdlib/source/test/lux/control/parser/cli.lux
@@ -1,6 +1,8 @@
(.module:
[lux #*
- data/text/format
+ [data
+ text/format
+ ["." name]]
["M" abstract/monad (#+ Monad do)]
["_" test (#+ Test)]
["r" math/random]
@@ -10,8 +12,8 @@
[data
["." error]
[number
- ["." nat ("#;." decimal)]]
- ["." text ("#;." equivalence)]
+ ["." nat ("#@." decimal)]]
+ ["." text ("#@." equivalence)]
[collection
["." list]]]]
{1
@@ -19,12 +21,12 @@
(def: #export test
Test
- (<| (_.context (%name (name-of /.CLI)))
+ (<| (_.context (name.module (name-of /._)))
(do r.monad
[num-args (|> r.nat (:: @ map (n/% 10)))
- #let [gen-arg (:: @ map nat;encode r.nat)]
+ #let [gen-arg (:: @ map nat@encode r.nat)]
yes gen-arg
- #let [gen-ignore (r.filter (|>> (text;= yes) not)
+ #let [gen-ignore (r.filter (|>> (text@= yes) not)
(r.unicode 5))]
no gen-ignore
pre-ignore (r.list 5 gen-ignore)
@@ -36,7 +38,7 @@
#0
(#error.Success arg)
- (text;= arg yes))))
+ (text@= arg yes))))
(_.test "Can test tokens."
(and (|> (/.run (list yes) (/.this yes))
(case> (#error.Failure _)
@@ -51,12 +53,12 @@
(#error.Success _)
#0))))
(_.test "Can use custom token parsers."
- (|> (/.run (list yes) (/.parse nat;decode))
+ (|> (/.run (list yes) (/.parse nat@decode))
(case> (#error.Failure _)
#0
(#error.Success parsed)
- (text;= (nat;encode parsed)
+ (text@= (nat@encode parsed)
yes))))
(_.test "Can query if there are any more inputs."
(and (|> (/.run (list) /.end)