1 USING: unrolled-lists tools.test deques kernel sequences
2 random prettyprint grouping math ;
3 IN: unrolled-lists.tests
5 { 1 } [ <unrolled-list> 1 over push-front pop-front ] unit-test
6 { 1 } [ <unrolled-list> 1 over push-front pop-back ] unit-test
7 { 1 } [ <unrolled-list> 1 over push-back pop-front ] unit-test
8 { 1 } [ <unrolled-list> 1 over push-back pop-back ] unit-test
11 <unrolled-list> 1 over push-back 2 over push-back
12 [ pop-front ] [ pop-front ] bi
16 <unrolled-list> 1 over push-back 2 over push-back
17 [ pop-back ] [ pop-back ] bi
25 [ pop-front ] [ pop-front ] [ pop-front ] tri
33 [ pop-back ] [ pop-back ] [ pop-back ] tri
36 { { 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 } } [
38 32 [ over push-front ] each-integer
39 32 [ dup pop-back ] replicate
43 { { 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 } } [
45 32 [ over push-front ] each-integer
46 32 [ dup pop-front ] replicate reverse
52 1000 [ 1000 random ] replicate
53 [ [ over push-front ] each ]
54 [ length [ dup pop-back ] replicate ]
63 1000 [ 1000 random ] replicate
66 [ [ over push-front ] each ]
67 [ length [ dup pop-back ] replicate ]
75 { t } [ <unrolled-list> deque-empty? ] unit-test
111 dup pop-back 21 assert=
113 dup pop-back 22 assert=
115 dup pop-back 25 assert=
117 dup pop-back 26 assert=
119 dup pop-back 28 assert=
120 dup pop-back 29 assert=
121 dup pop-back 24 assert=
123 dup pop-back 23 assert=
125 dup pop-back 17 assert=
127 dup pop-back 27 assert=
128 dup pop-back 30 assert=