diff options
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/data/bit.lux | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/stdlib/test/test/lux/data/bit.lux b/stdlib/test/test/lux/data/bit.lux index f8c9bc8ef..1b8110d31 100644 --- a/stdlib/test/test/lux/data/bit.lux +++ b/stdlib/test/test/lux/data/bit.lux @@ -14,12 +14,14 @@ idx (:: @ map (n/% &.width) r.nat)] ($_ seq (test "Clearing and settings bits should alter the count." - (and (n/< (&.count (&.set idx pattern)) + (and (n/= (n/dec (&.count (&.set idx pattern))) (&.count (&.clear idx pattern))) - (n/<= (&.count pattern) - (&.count (&.clear idx pattern))) - (n/>= (&.count pattern) - (&.count (&.set idx pattern))))) + (|> (&.count pattern) + (n/- (&.count (&.clear idx pattern))) + (n/<= +1)) + (|> (&.count (&.set idx pattern)) + (n/- (&.count pattern)) + (n/<= +1)))) (test "Can query whether a bit is set." (and (or (and (&.set? idx pattern) (not (&.set? idx (&.clear idx pattern)))) @@ -30,7 +32,7 @@ (not (&.set? idx (&.flip idx pattern)))) (and (not (&.set? idx pattern)) (&.set? idx (&.flip idx pattern)))))) - (test "The negation of a bit pattern should have a complementary bit count." + (test "The negation of a bit pattern should have a complementary bit-count." (n/= &.width (n/+ (&.count pattern) (&.count (&.not pattern))))) |