]> gitweb.factorcode.org Git - factor.git/blob - libs/gap-buffer/circular-tests.factor
409359d76c0e3b6527960f094680e7f5aa7ea94d
[factor.git] / libs / gap-buffer / circular-tests.factor
1 USING: kernel test sequences sequences-internals circular ;
2
3 [ 0 ] [ { 0 1 2 3 4 } <circular> 0 swap circular@ drop ] unit-test
4 [ 2 ] [ { 0 1 2 3 4 } <circular> 2 swap circular@ drop ] unit-test
5
6 [ CHAR: t ] [ "test" <circular> 0 swap nth ] unit-test
7 [ "test"  ] [ "test" <circular> "" like ] unit-test
8
9 [ "test" <circular> 5 swap nth ] unit-test-fails
10 [ CHAR: e ] [ "test" <circular> 5 swap nth-unsafe ] unit-test
11  
12 [ [ 1 2 3 ] ] [ { 1 2 3 } <circular> [ ] like ] unit-test
13 [ [ 2 3 1 ] ] [ { 1 2 3 } <circular> 1 over change-circular-start [ ] like ] unit-test
14 [ [ 3 1 2 ] ] [ { 1 2 3 } <circular> 1 over change-circular-start 1 over change-circular-start [ ] like ] unit-test
15
16 [ "fob" ] [ "foo" <circular> CHAR: b 2 pick set-nth "" like ] unit-test
17 [ "foo" <circular> CHAR: b 3 rot set-nth ] unit-test-fails
18 [ "boo" ] [ "foo" <circular> CHAR: b 3 pick set-nth-unsafe "" like ] unit-test
19 [ "ornact" ] [ "factor" <circular> 4 over change-circular-start CHAR: n 2 pick set-nth "" like ] unit-test
20