diff options
author | Eduardo Julian | 2017-10-16 19:37:58 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-16 19:37:58 -0400 |
commit | f54e6e22e5044a0cdf28e5ee01e90e1866b29dfc (patch) | |
tree | ea3b72fa18e36ec0830677ac417a3c13d82a6305 /stdlib/test | |
parent | fecfb6c1dd653e491e541233395ea4a7d8ae7409 (diff) |
- Removed the useless Seq type.
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/data/coll/seq.lux | 129 | ||||
-rw-r--r-- | stdlib/test/tests.lux | 1 |
2 files changed, 0 insertions, 130 deletions
diff --git a/stdlib/test/test/lux/data/coll/seq.lux b/stdlib/test/test/lux/data/coll/seq.lux deleted file mode 100644 index 801c5c2f1..000000000 --- a/stdlib/test/test/lux/data/coll/seq.lux +++ /dev/null @@ -1,129 +0,0 @@ -(;module: - lux - (lux [io] - (control [monad #+ do Monad] - pipe) - (data (coll ["&" seq] - ["F" tree/finger] - ["L" list]) - [text "Text/" Monoid<Text>] - [number] - [bool] - [product] - maybe) - ["r" math/random]) - lux/test) - -(def: bounded-size - (r;Random Nat) - (|> r;nat - (:: r;Monad<Random> map (|>. (n.% +100) (n.+ +10) (n.max +1))))) - -(context: "Seqs: Part 1" - [size bounded-size - idx (:: @ map (n.% size) r;nat) - sample (|> (r;list size r;nat) - (:: @ map &;from-list)) - extra r;nat - #let [(^open "&/") (&;Eq<Seq> number;Eq<Nat>)]] - ($_ seq - (test "Can convert to/from list." - (|> sample - &;to-list &;from-list - (&/= sample))) - - (test "The size function should correctly portray the size of the seq." - (n.= size (&;size sample))) - - (test "Reversing a seq does not change it's size." - (n.= (&;size sample) - (&;size (&;reverse sample)))) - - (test "Reversing a seq twice results in the original seq." - (&/= sample - (&;reverse (&;reverse sample)))) - - (test "If every element in a list satisfies a predicate, there can't be any that satisfy its complement." - (if (&;every? n.even? sample) - (not (&;any? (bool;complement n.even?) sample)) - (&;any? (bool;complement n.even?) sample))) - - (test "Any element of the list can be considered its member." - (and (&;member? number;Eq<Nat> - (&;prepend extra sample) - extra) - (&;member? number;Eq<Nat> - (&;compose extra sample) - extra))) - - (test "Can do random access to seq elements." - (and (|> (&;prepend extra sample) - (&;nth +0) - (case> (#;Some reference) - (n.= reference extra) - - _ - false)) - (|> (&;compose extra sample) - (&;nth size) - (case> (#;Some reference) - (n.= reference extra) - - _ - false)))) - )) - -(context: "Seqs: Part 2" - [size bounded-size - sample (|> (r;list size r;nat) - (:: @ map &;from-list)) - #let [(^open "&/") (&;Eq<Seq> number;Eq<Nat>) - (^open "&/") &;Functor<Seq>]] - ($_ seq - (test "Functor should go over every element of the seq." - (let [there (&/map n.inc sample) - back-again (&/map n.dec there)] - (and (not (&/= sample there)) - (&/= sample back-again)))) - - (test "Sorting a seq shouldn't change it's size." - (n.= (&;size sample) - (&;size (&;sort n.< sample)))) - - (test "Sorting a seq with one order should yield the reverse of sorting it with the opposite order." - (&/= (&;sort n.< sample) - (&;reverse (&;sort n.> sample)))) - )) - -(context: "Seqs: Part 3" - [size bounded-size - idx (:: @ map (n.% size) r;nat) - sample (|> (r;list size r;nat) - (:: @ map &;from-list)) - other-size bounded-size - other-sample (|> (r;list other-size r;nat) - (:: @ map &;from-list)) - elem r;nat - #let [(^open "&/") (&;Eq<Seq> number;Eq<Nat>) - (^open "&/") &;Monad<Seq>]] - ($_ seq - (test "Applicative allows you to create singleton seqs, and apply seqs of functions to seqs of values." - (and (&/= (&;seq elem) (&/wrap elem)) - (&/= (&/map n.inc sample) - (&/apply (&/wrap n.inc) sample)))) - - (test "Seq concatenation is a monad." - (&/= (&;concat sample other-sample) - (&/join (&;seq sample other-sample)))) - - (test "You can find any value that satisfies some criterium, if such values exist in the seq." - (case (&;find n.even? sample) - (#;Some found) - (and (n.even? found) - (&;any? n.even? sample) - (not (&;every? (bool;complement n.even?) sample))) - - #;None - (and (not (&;any? n.even? sample)) - (&;every? (bool;complement n.even?) sample)))) - )) diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index 085275e62..b7f097fa2 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -49,7 +49,6 @@ ["_;" set] ["_;" stack] ["_;" vector] - ["_;" seq] ["_;" priority-queue] ["_;" stream] (tree ["tree_;" rose] |