]> gitweb.factorcode.org Git - factor.git/blob - basis/specialized-arrays/specialized-arrays-tests.factor
Functor-generated words can now have stack effect declarations; define byte-array...
[factor.git] / basis / specialized-arrays / specialized-arrays-tests.factor
1 IN: specialized-arrays.tests
2 USING: tools.test specialized-arrays sequences
3 specialized-arrays.int specialized-arrays.bool
4 specialized-arrays.ushort alien.c-types accessors kernel ;
5
6 [ t ] [ { 1 2 3 } >int-array int-array? ] unit-test
7
8 [ t ] [ int-array{ 1 2 3 } int-array? ] unit-test
9
10 [ 2 ] [ int-array{ 1 2 3 } second ] unit-test
11
12 [ t ] [ { t f t } >bool-array underlying>> { 1 0 1 } >int-array underlying>> = ] unit-test
13
14 [ ushort-array{ 1234 } ] [
15     little-endian? B{ 210 4 } B{ 4 210 } ? byte-array>ushort-array
16 ] unit-test
17
18 [ B{ 210 4 1 } byte-array>ushort-array ] must-fail