diff options
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/data/collection/list.lux | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index 5003567ee..a91db974f 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -281,8 +281,18 @@ sample/2 ..random] ($_ _.and (_.cover [/.pairs] - (n.= (n./ 2 (/.size sample/0)) - (/.size (/.pairs sample/0)))) + (let [even_sized? (|> sample/0 + /.size + (n.% 2) + (n.= 0))] + (case (/.pairs sample/0) + {.#Some pairs/0} + (and even_sized? + (n.= (n./ 2 (/.size sample/0)) + (/.size pairs/0))) + + {.#None} + (not even_sized?)))) (_.cover [/.zipped/2] (let [zipped (/.zipped/2 sample/0 sample/1) zipped::size (/.size zipped) @@ -412,7 +422,10 @@ (let [sample+ (/.interposed separator sample)] (and (n.= (|> (/.size sample) (n.* 2) --) (/.size sample+)) - (|> sample+ /.pairs (/.every? (|>> product.right (n.= separator)))))))) + (|> sample+ + /.pairs + (maybe.else (list)) + (/.every? (|>> product.right (n.= separator)))))))) (_.cover [/.iterations] (or (/.empty? sample) (let [size (/.size sample)] |