diff options
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r-- | stdlib/source/test/lux/data/collection/array.lux | 49 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/text.lux | 18 |
2 files changed, 33 insertions, 34 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)))))) )))) diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index df0c6000c..aa30ee356 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -96,22 +96,22 @@ (|> (/.index outer (\ /.monoid composite inner outer)) (maybe.else fake_index) (n.= 1)))) - (_.cover [/.index'] + (_.cover [/.index_since] (let [full (\ /.monoid composite inner outer)] - (and (|> (/.index' 0 inner full) + (and (|> (/.index_since 0 inner full) (maybe.else fake_index) (n.= 0)) - (|> (/.index' 1 inner full) + (|> (/.index_since 1 inner full) (maybe.else fake_index) (n.= fake_index)) - (|> (/.index' 0 outer full) + (|> (/.index_since 0 outer full) (maybe.else fake_index) (n.= 1)) - (|> (/.index' 1 outer full) + (|> (/.index_since 1 outer full) (maybe.else fake_index) (n.= 1)) - (|> (/.index' 2 outer full) + (|> (/.index_since 2 outer full) (maybe.else fake_index) (n.= fake_index))))) (_.cover [/.last_index] @@ -297,11 +297,11 @@ _ #0))) - (_.cover [/.clip /.clip'] + (_.cover [/.clip /.clip_since] (|> [(/.clip 0 sizeL sample) (/.clip sizeL (n.- sizeL (/.size sample)) sample) - (/.clip' sizeL sample) - (/.clip' 0 sample)] + (/.clip_since sizeL sample) + (/.clip_since 0 sample)] (case> [(#.Right _l) (#.Right _r) (#.Right _r') (#.Right _f)] (and (/\= sampleL _l) (/\= sampleR _r) |