aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/data/coll/sequence.lux (renamed from stdlib/test/test/lux/data/coll/stream.lux)24
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/test/test/lux/data/coll/stream.lux b/stdlib/test/test/lux/data/coll/sequence.lux
index 9431e2a46..44eea350b 100644
--- a/stdlib/test/test/lux/data/coll/stream.lux
+++ b/stdlib/test/test/lux/data/coll/sequence.lux
@@ -7,12 +7,12 @@
[text "Text/" Monoid<Text>]
text/format
(coll [list]
- ["&" stream])
+ ["&" sequence])
[number "Nat/" Codec<Text,Nat>])
["r" math/random])
lux/test)
-(context: "Streams"
+(context: "Sequences"
(<| (times +100)
(do @
[size (|> r.nat (:: @ map (|>> (n/% +100) (n/max +2))))
@@ -25,7 +25,7 @@
sample0 (&.iterate inc +0)
sample1 (&.iterate inc offset)]]
($_ seq
- (test "Can move along a stream and take slices off it."
+ (test "Can move along a sequence and take slices off it."
(and (and (List/= (list.n/range +0 (dec size))
(&.take size sample0))
(List/= (list.n/range offset (dec (n/+ offset size)))
@@ -50,12 +50,12 @@
(test "Can repeat any element and infinite number of times."
(n/= elem (&.nth offset (&.repeat elem))))
- (test "Can obtain the head & tail of a stream."
+ (test "Can obtain the head & tail of a sequence."
(and (n/= offset (&.head sample1))
(List/= (list.n/range (inc offset) (n/+ offset size))
(&.take size (&.tail sample1)))))
- (test "Can filter streams."
+ (test "Can filter sequences."
(and (n/= (n/* +2 offset)
(&.nth offset
(&.filter n/even? sample0)))
@@ -65,8 +65,8 @@
(n/= (inc (n/* +2 offset))
(&.nth offset odds))))))
- (test "Functor goes over 'all' elements in a stream."
- (let [(^open "&/") &.Functor<Stream>
+ (test "Functor goes over 'all' elements in a sequence."
+ (let [(^open "&/") &.Functor<Sequence>
there (&/map (n/* factor) sample0)
back-again (&/map (n// factor) there)]
(and (not (List/= (&.take size sample0)
@@ -74,16 +74,16 @@
(List/= (&.take size sample0)
(&.take size back-again)))))
- (test "CoMonad produces a value for every element in a stream."
- (let [(^open "&/") &.Functor<Stream>]
+ (test "CoMonad produces a value for every element in a sequence."
+ (let [(^open "&/") &.Functor<Sequence>]
(List/= (&.take size (&/map (n/* factor) sample1))
(&.take size
- (be &.CoMonad<Stream>
+ (be &.CoMonad<Sequence>
[inputs sample1]
(n/* factor (&.head inputs)))))))
(test "'unfold' generalizes 'iterate'."
- (let [(^open "&/") &.Functor<Stream>
+ (let [(^open "&/") &.Functor<Sequence>
(^open "List/") (list.Eq<List> text.Eq<Text>)]
(List/= (&.take size
(&/map Nat/encode (&.iterate inc offset)))
@@ -91,7 +91,7 @@
(&.unfold (function (_ n) [(inc n) (Nat/encode n)])
offset)))))
- (test "Can cycle over the same elements as an infinite stream."
+ (test "Can cycle over the same elements as an infinite sequence."
(|> (&.cycle cycle-seed)
maybe.assume
(&.nth cycle-sample-idx)