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 ;
5 { t } [ 0b111111 3 <bits> second ] unit-test
6 { { t t t } } [ 0b111111 3 <bits> >array ] unit-test
7 { f } [ 0b111101 3 <bits> second ] unit-test
8 { { f f t } } [ 0b111100 3 <bits> >array ] unit-test
9 { 3 } [ 0b111111 3 <bits> length ] unit-test
10 { 6 } [ 0b111111 make-bits length ] unit-test
11 { 0 } [ 0 make-bits length ] unit-test
12 { 2 } [ 3 make-bits length ] unit-test
13 { 1 } [ 1 make-bits length ] unit-test
14 [ -3 make-bits length ] [ non-negative-integer-expected? ] must-fail-with
18 1067811677921310779 make-bits
19 1067811677921310779 >bignum make-bits
24 1067811677921310779 make-bits last
28 1067811677921310779 >bignum make-bits last
31 { 6 } [ 6 make-bits bits>number ] unit-test
32 { 6 } [ 6 3 <bits> >array bits>number ] unit-test