Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / basis / persistent / deques / deques-tests.factor
blob96c7bd7ea2a2f3039232c8108b3cdfc5ca8d21e5
1 ! Copyback (C) 2008 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test persistent.deques kernel math ;
4 IN: persistent.deques.tests
6 [ 3 2 1 t ]
7 [ { 1 2 3 } sequence>deque 3 [ pop-back ] times deque-empty? ] unit-test
9 [ 1 2 3 t ]
10 [ { 1 2 3 } sequence>deque 3 [ pop-front ] times deque-empty? ] unit-test
12 [ 1 3 2 t ]
13 [ { 1 2 3 } sequence>deque pop-front 2 [ pop-back ] times deque-empty? ]
14 unit-test
16 [ { 2 3 4 5 6 1 } ]
17 [ { 1 2 3 4 5 6 } sequence>deque pop-front swap push-back deque>sequence ]
18 unit-test
20 [ 1 ] [ { 1 2 3 4 } sequence>deque peek-front ] unit-test
21 [ 4 ] [ { 1 2 3 4 } sequence>deque peek-back ] unit-test
23 [ 1 t ] [ <deque> 1 push-front pop-back deque-empty? ] unit-test
24 [ 1 t ] [ <deque> 1 push-front pop-front deque-empty? ] unit-test
25 [ 1 t ] [ <deque> 1 push-back pop-front deque-empty? ] unit-test
26 [ 1 t ] [ <deque> 1 push-back pop-back deque-empty? ] unit-test
28 [ 1 f ]
29 [ <deque> 1 push-front 2 push-front pop-back deque-empty? ] unit-test
31 [ 1 f ]
32 [ <deque> 1 push-back 2 push-back pop-front deque-empty? ] unit-test
34 [ 2 f ]
35 [ <deque> 1 push-back 2 push-back pop-back deque-empty? ] unit-test
37 [ 2 f ]
38 [ <deque> 1 push-front 2 push-front pop-front deque-empty? ] unit-test