]> gitweb.factorcode.org Git - factor.git/blob - extra/bitfields/bitfields-tests.factor
FUEL: Fix bug whereby true display-stacks? could hang the listener.
[factor.git] / extra / bitfields / bitfields-tests.factor
1 USING: tools.test bitfields kernel ;
2 IN: bitfields.tests
3
4 SAFE-BITFIELD: foo bar:5 baz:10 111 bing:2 ;
5
6 [ 21 ] [ 21 852 3 <foo> foo-bar ] unit-test
7 [ 852 ] [ 21 852 3 <foo> foo-baz ] unit-test
8 [ 3 ] [ 21 852 3 <foo> foo-bing ] unit-test
9
10 [ 23 ] [ 21 852 3 <foo> 23 swap with-foo-bar foo-bar ] unit-test
11 [ 855 ] [ 21 852 3 <foo> 855 swap with-foo-baz foo-baz ] unit-test
12 [ 1 ] [ 21 852 3 <foo> 1 swap with-foo-bing foo-bing ] unit-test
13
14 [ 100 0 0 <foo> ] must-fail
15 [ 0 5000 0 <foo> ] must-fail
16 [ 0 0 10 <foo> ] must-fail
17
18 [ 100 0 with-foo-bar ] must-fail
19 [ 5000 0 with-foo-baz ] must-fail
20 [ 10 0 with-foo-bing ] must-fail
21
22 [ BIN: 00101100000000111111 ] [ BIN: 101 BIN: 1000000001 BIN: 11 <foo> ] unit-test