diff options
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/data/bit.lux | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/stdlib/test/test/lux/data/bit.lux b/stdlib/test/test/lux/data/bit.lux index 2ba2c8e57..fe04806cd 100644 --- a/stdlib/test/test/lux/data/bit.lux +++ b/stdlib/test/test/lux/data/bit.lux @@ -7,11 +7,9 @@ ["R" math/random]) lux/test) -(def: width Nat +64) - (test: "Bitwise operations." [pattern R;nat - idx (:: @ map (n.% width) R;nat)] + idx (:: @ map (n.% &;width) R;nat)] ($_ seq (assert "Clearing and settings bits should alter the count." (and (n.< (&;count (&;set idx pattern)) @@ -31,7 +29,7 @@ (and (not (&;set? idx pattern)) (&;set? idx (&;flip idx pattern)))))) (assert "The negation of a bit pattern should have a complementary bit count." - (n.= width + (n.= &;width (n.+ (&;count pattern) (&;count (&;not pattern))))) (assert "Can do simple binary boolean logic." @@ -58,10 +56,10 @@ (n.= pattern)))) (assert "Rotate as many spaces as the bit-pattern's width leaves the pattern unchanged." (and (|> pattern - (&;rotate-left width) + (&;rotate-left &;width) (n.= pattern)) (|> pattern - (&;rotate-right width) + (&;rotate-right &;width) (n.= pattern)))) (assert "Shift right respect the sign of ints." (let [value (nat-to-int pattern)] |