]> gitweb.factorcode.org Git - factor.git/blob - basis/sequences/unrolled/unrolled-tests.factor
e0d70b4fa7dbc1c39b68ed3966bb3653d7164708
[factor.git] / basis / sequences / unrolled / unrolled-tests.factor
1 ! (c)2010 Joe Groff bsd license
2 USING: compiler.test compiler.tree.debugger kernel make math.parser sequences
3 sequences.unrolled tools.test ;
4 IN: sequences.unrolled.tests
5
6 [ { "0" "1" "2" } ] [ { 0 1 2 } 3 [ number>string ] unrolled-map ] unit-test
7 [ { "0" "1" "2" } ] [ { 0 1 2 } [ 3 [ number>string ] unrolled-map ] compile-call ] unit-test
8
9 [ { "0" "1" "2" } ] [ [ { 0 1 2 } 3 [ number>string , ] unrolled-each ] { } make ] unit-test
10 [ { "0" "1" "2" } ] [ [ { 0 1 2 } [ 3 [ number>string , ] unrolled-each ] compile-call ] { } make ] unit-test
11
12 [ { "a0" "b1" "c2" } ]
13 [ [ { "a" "b" "c" } 3 [ number>string append , ] unrolled-each-index ] { } make ] unit-test
14
15 [ { "a0" "b1" "c2" } ]
16 [ [ { "a" "b" "c" } [ 3 [ number>string append , ] unrolled-each-index ] compile-call ] { } make ] unit-test
17
18 [ { "aI" "bII" "cIII" } ]
19 [ [ { "a" "b" "c" } { "I" "II" "III" } [ 3 [ append , ] unrolled-2each ] compile-call ] { } make ] unit-test
20
21 [ { "aI" "bII" "cIII" } ]
22 [ { "a" "b" "c" } { "I" "II" "III" } 3 [ append ] unrolled-2map ] unit-test
23
24 [ { "aI" "bII" "cIII" } ]
25 [ { "a" "b" "c" } { "I" "II" "III" } [ 3 [ append ] unrolled-2map ] compile-call ] unit-test
26
27 [ { "a0" "b1" "c2" } ]
28 [ { "a" "b" "c" } 3 [ number>string append ] unrolled-map-index ] unit-test
29
30 [ { "a0" "b1" "c2" } ]
31 [ { "a" "b" "c" } [ 3 [ number>string append ] unrolled-map-index ] compile-call ] unit-test
32
33 [ { 0 1 2 } 4 [ number>string ] unrolled-map ] [ unrolled-bounds-error? ] must-fail-with
34 [ { 0 1 2 3 } { 0 1 2 } 4 [ number>string append ] unrolled-2map ] [ unrolled-2bounds-error? ] must-fail-with
35
36 [ t ]
37 [ [ 3 [ number>string ] unrolled-map ] { call } inlined? ] unit-test
38
39 [ t ]
40 [ [ 3 [ number>string , ] unrolled-each ] { call } inlined? ] unit-test
41
42 [ t ]
43 [ [ 3 [ number>string append , ] unrolled-each-index ] { call } inlined? ] unit-test
44
45 [ t ]
46 [ [ 3 [ append , ] unrolled-2each ] { call } inlined? ] unit-test
47
48 [ t ]
49 [ [ 3 [ append ] unrolled-2map ] { call } inlined? ] unit-test
50
51 [ t ]
52 [ [ 3 [ number>string append ] unrolled-map-index ] { call } inlined? ] unit-test