aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data/collection/array.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/data/collection/array.lux49
1 files changed, 24 insertions, 25 deletions
diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux
index 03ff479ff..08064ff74 100644
--- a/stdlib/source/test/lux/data/collection/array.lux
+++ b/stdlib/source/test/lux/data/collection/array.lux
@@ -59,7 +59,7 @@
(_.cover [/.example]
(\ (maybe.equivalence n.equivalence) =
(/.example n.even? the_array)
- (list.example n.even? (/.list the_array))))
+ (list.example n.even? (/.list #.None the_array))))
(_.cover [/.example+]
(case [(/.example n.even? the_array)
(/.example+ (function (_ idx member)
@@ -81,11 +81,11 @@
false))
(_.cover [/.every?]
(\ bit.equivalence =
- (list.every? n.even? (/.list the_array))
+ (list.every? n.even? (/.list #.None the_array))
(/.every? n.even? the_array)))
(_.cover [/.any?]
(\ bit.equivalence =
- (list.any? n.even? (/.list the_array))
+ (list.any? n.even? (/.list #.None the_array))
(/.any? n.even? the_array)))
)))
@@ -182,12 +182,24 @@
(n.= size (n.+ (/.occupancy the_array)
(/.vacancy the_array)))))))
(do !
- [the_list (random.list size random.nat)]
+ [the_list (random.list size random.nat)
+ .let [the_array (/.clone the_array)
+ members (|> the_array (/.list #.None) (set.of_list n.hash))]
+ default (random.only (function (_ value)
+ (not (or (n.even? value)
+ (set.member? members value))))
+ random.nat)]
(_.cover [/.of_list /.list]
- (and (|> the_list /.of_list /.list
+ (and (|> the_list /.of_list (/.list #.None)
(\ (list.equivalence n.equivalence) = the_list))
- (|> the_array /.list /.of_list
- (\ (/.equivalence n.equivalence) = the_array)))))
+ (|> the_array (/.list #.None) /.of_list
+ (\ (/.equivalence n.equivalence) = the_array))
+ (exec
+ (/.filter! n.even? the_array)
+ (list.every? (function (_ value)
+ (or (n.even? value)
+ (same? default value)))
+ (/.list (#.Some default) the_array))))))
(do !
[amount (\ ! each (n.% (++ size)) random.nat)]
(_.cover [/.copy!]
@@ -195,31 +207,18 @@
(/.empty size))]
(exec (/.copy! amount 0 the_array 0 copy)
(\ (list.equivalence n.equivalence) =
- (list.first amount (/.list the_array))
- (/.list copy))))))
+ (list.first amount (/.list #.None the_array))
+ (/.list #.None copy))))))
(_.cover [/.clone]
(let [clone (/.clone the_array)]
(and (not (same? the_array clone))
(\ (/.equivalence n.equivalence) = the_array clone))))
(let [the_array (/.clone the_array)
- evens (|> the_array /.list (list.only n.even?))
- odds (|> the_array /.list (list.only n.odd?))]
+ evens (|> the_array (/.list #.None) (list.only n.even?))
+ odds (|> the_array (/.list #.None) (list.only n.odd?))]
(_.cover [/.filter!]
(exec (/.filter! n.even? the_array)
(and (n.= (list.size evens) (/.occupancy the_array))
(n.= (list.size odds) (/.vacancy the_array))
- (|> the_array /.list (\ (list.equivalence n.equivalence) = evens))))))
- (do !
- [.let [the_array (/.clone the_array)
- members (|> the_array /.list (set.of_list n.hash))]
- default (random.only (function (_ value)
- (not (or (n.even? value)
- (set.member? members value))))
- random.nat)]
- (_.cover [/.list']
- (exec (/.filter! n.even? the_array)
- (list.every? (function (_ value)
- (or (n.even? value)
- (same? default value)))
- (/.list' default the_array)))))
+ (|> the_array (/.list #.None) (\ (list.equivalence n.equivalence) = evens))))))
))))