aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data/collection/bits.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/data/collection/bits.lux')
-rw-r--r--stdlib/source/test/lux/data/collection/bits.lux40
1 files changed, 20 insertions, 20 deletions
diff --git a/stdlib/source/test/lux/data/collection/bits.lux b/stdlib/source/test/lux/data/collection/bits.lux
index da4a759e5..6710ef7c6 100644
--- a/stdlib/source/test/lux/data/collection/bits.lux
+++ b/stdlib/source/test/lux/data/collection/bits.lux
@@ -27,7 +27,7 @@
0 (in /.empty)
_ (do {! random.monad}
[idx (|> random.nat (\ ! map (n.% size)))]
- (in (/.set idx /.empty))))))
+ (in (/.one idx /.empty))))))
(def: .public test
Test
@@ -51,38 +51,38 @@
idx (\ ! map (n.% size) random.nat)
sample ..random]
($_ _.and
- (_.cover [/.get /.set]
- (and (|> /.empty (/.get idx) not)
- (|> /.empty (/.set idx) (/.get idx))))
- (_.cover [/.clear]
- (|> /.empty (/.set idx) (/.clear idx) (/.get idx) not))
- (_.cover [/.flip]
- (and (|> /.empty (/.flip idx) (/.get idx))
- (|> /.empty (/.flip idx) (/.flip idx) (/.get idx) not)))
+ (_.cover [/.bit /.one]
+ (and (|> /.empty (/.bit idx) not)
+ (|> /.empty (/.one idx) (/.bit idx))))
+ (_.cover [/.zero]
+ (|> /.empty (/.one idx) (/.zero idx) (/.bit idx) not))
+ (_.cover [/.flipped]
+ (and (|> /.empty (/.flipped idx) (/.bit idx))
+ (|> /.empty (/.flipped idx) (/.flipped idx) (/.bit idx) not)))
(_.cover [/.Chunk /.capacity /.chunk_size]
(and (n.= 0 (/.capacity /.empty))
- (|> /.empty (/.set idx) /.capacity
+ (|> /.empty (/.one idx) /.capacity
(n.- idx)
(predicate.or (n.>= 0)
(n.< /.chunk_size)))
- (let [grown (/.flip idx /.empty)]
+ (let [grown (/.flipped idx /.empty)]
(and (n.> 0 (/.capacity grown))
- (is? /.empty (/.flip idx grown))))))
+ (same? /.empty (/.flipped idx grown))))))
(_.cover [/.intersects?]
(and (not (/.intersects? /.empty
/.empty))
- (/.intersects? (/.set idx /.empty)
- (/.set idx /.empty))
- (not (/.intersects? (/.set (inc idx) /.empty)
- (/.set idx /.empty)))
+ (/.intersects? (/.one idx /.empty)
+ (/.one idx /.empty))
+ (not (/.intersects? (/.one (inc idx) /.empty)
+ (/.one idx /.empty)))
(not (/.intersects? sample (/.not sample)))))
(_.cover [/.not]
- (and (is? /.empty (/.not /.empty))
- (or (is? /.empty sample)
+ (and (same? /.empty (/.not /.empty))
+ (or (same? /.empty sample)
(and (not (\ /.equivalence = sample (/.not sample)))
(\ /.equivalence = sample (/.not (/.not sample)))))))
(_.cover [/.xor]
- (and (is? /.empty (/.xor sample sample))
+ (and (same? /.empty (/.xor sample sample))
(n.= (/.size (/.xor sample (/.not sample)))
(/.capacity sample))))
(_.cover [/.or]
@@ -91,5 +91,5 @@
(/.capacity sample))))
(_.cover [/.and]
(and (\ /.equivalence = sample (/.and sample sample))
- (is? /.empty (/.and sample (/.not sample)))))
+ (same? /.empty (/.and sample (/.not sample)))))
)))))