aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux/control/pipe.lux43
1 files changed, 20 insertions, 23 deletions
diff --git a/stdlib/test/test/lux/control/pipe.lux b/stdlib/test/test/lux/control/pipe.lux
index 23e6cfe60..527db91c3 100644
--- a/stdlib/test/test/lux/control/pipe.lux
+++ b/stdlib/test/test/lux/control/pipe.lux
@@ -1,13 +1,13 @@
(;module:
lux
(lux [io]
- (control ["M" monad #+ do Monad]
+ (control [monad #+ do Monad]
pipe)
(data text/format
[number]
[product]
identity
- [text "T/" Eq<Text>])
+ [text "text/" Eq<Text>])
["r" math/random])
lux/test)
@@ -17,44 +17,41 @@
(|> 20
(i.* 3)
(i.+ 4)
- (_> 0 i.inc)
+ (new> 0 i.inc)
(i.= 1)))
(test "Can give names to piped values within a pipeline's scope."
- (and (|> 5
- (@> [(i.+ @ @)])
- (i.= 10))
- (|> 5
- (@> X [(i.+ X X)])
- (i.= 10))))
+ (|> 5
+ (let> X [(i.+ X X)])
+ (i.= 10)))
(test "Can do branching in pipelines."
(and (|> 5
- (?> [i.even?] [(i.* 2)]
- [i.odd?] [(i.* 3)]
- [(_> -1)])
+ (cond> [i.even?] [(i.* 2)]
+ [i.odd?] [(i.* 3)]
+ [(new> -1)])
(i.= 15))
(|> 4
- (?> [i.even?] [(i.* 2)]
- [i.odd?] [(i.* 3)])
+ (cond> [i.even?] [(i.* 2)]
+ [i.odd?] [(i.* 3)])
(i.= 8))
(|> 5
- (?> [i.even?] [(i.* 2)]
- [(_> -1)])
+ (cond> [i.even?] [(i.* 2)]
+ [(new> -1)])
(i.= -1))))
(test "Can loop within pipelines."
(|> 1
- (!> [(i.< 10)]
- [i.inc])
+ (loop> [(i.< 10)]
+ [i.inc])
(i.= 10)))
(test "Can use monads within pipelines."
(|> 5
- (%> Monad<Identity>
- [(i.* 3)]
- [(i.+ 4)]
- [i.inc])
+ (do> Monad<Identity>
+ [(i.* 3)]
+ [(i.+ 4)]
+ [i.inc])
(i.= 20)))
(test "Can pattern-match against piped values."
@@ -70,5 +67,5 @@
8 "eight"
9 "nine"
_ "???")
- (T/= "five")))
+ (text/= "five")))
))