1 ! Copyright (C) 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test math math.bits sequences arrays ;
6 { t } [ 0b111111 3 <bits> second ] unit-test
7 { { t t t } } [ 0b111111 3 <bits> >array ] unit-test
8 { f } [ 0b111101 3 <bits> second ] unit-test
9 { { f f t } } [ 0b111100 3 <bits> >array ] unit-test
10 { 3 } [ 0b111111 3 <bits> length ] unit-test
11 { 6 } [ 0b111111 make-bits length ] unit-test
12 { 0 } [ 0 make-bits length ] unit-test
13 { 2 } [ 3 make-bits length ] unit-test
14 { 1 } [ 1 make-bits length ] unit-test
15 [ -3 make-bits length ] [ non-negative-integer-expected? ] must-fail-with
19 1067811677921310779 make-bits
20 1067811677921310779 >bignum make-bits
25 1067811677921310779 make-bits last
29 1067811677921310779 >bignum make-bits last
32 { 6 } [ 6 make-bits bits>number ] unit-test
33 { 6 } [ 6 3 <bits> >array bits>number ] unit-test