aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r--stdlib/source/test/lux/data/binary.lux14
1 files changed, 12 insertions, 2 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux
index 0a354092d..c9e821229 100644
--- a/stdlib/source/test/lux/data/binary.lux
+++ b/stdlib/source/test/lux/data/binary.lux
@@ -19,8 +19,8 @@
[math
["[0]" random {"+" Random}]
[number
- ["[0]" i64]
- ["n" nat]]]]]
+ ["n" nat]
+ ["[0]" i64]]]]]
[\\library
["[0]" /
["!" \\unsafe]]])
@@ -204,6 +204,7 @@
(_.cover [/.after]
(and (# /.equivalence = sample (/.after 0 sample))
(# /.equivalence = (/.empty 0) (/.after size sample))
+ (n.= (n.- offset size) (/.size (/.after offset sample)))
(case (list.reversed (..as_list sample))
{.#End}
false
@@ -227,6 +228,15 @@
copy/1 (/.read/8! 1 copy)]
(in (and (n.= sample/0 copy/0)
(n.= 0 copy/1)))))))
+ (_.cover [/.cannot_copy]
+ (and (not (throws? /.cannot_copy
+ (/.copy size 0 sample 0 (/.empty size))))
+ (throws? /.cannot_copy
+ (/.copy (n.+ offset size) 0 sample 0 (/.empty size)))
+ (throws? /.cannot_copy
+ (/.copy size offset sample 0 (/.empty size)))
+ (throws? /.cannot_copy
+ (/.copy size 0 sample offset (/.empty size)))))
..test|unsafe
))))