]> gitweb.factorcode.org Git - factor.git/blob - apps/tetris/test/tetris-board.factor
more sql changes
[factor.git] / apps / tetris / test / tetris-board.factor
1 USING: kernel tetris-colours tetris-board tetris-piece test arrays ;
2
3 [ { { f f } { f f } { f f } } ] [ 2 3 make-rows ] unit-test
4 [ { { f f } { f f } { f f } } ] [ 2 3 <board> board-rows ] unit-test
5 [ 1 { f f } ] [ 2 3 <board> { 1 1 } board@block ] unit-test
6 [ f ] [ 2 3 <board> { 1 1 } board-block ] unit-test
7 [ 2 3 <board> { 2 3 } board-block ] unit-test-fails
8 red 1array [ 2 3 <board> dup { 1 1 } red board-set-block { 1 1 } board-block ] unit-test
9 [ t ] [ 2 3 <board> { 1 1 } block-free? ] unit-test
10 [ f ] [ 2 3 <board> dup { 1 1 } red board-set-block { 1 1 } block-free? ] unit-test
11 [ t ] [ 2 3 <board> dup { 1 1 } red board-set-block { 1 2 } block-free? ] unit-test
12 [ t ] [ 2 3 <board> dup { 1 1 } red board-set-block { 0 1 } block-free? ] unit-test
13 [ t ] [ 2 3 <board> { 0 0 } block-in-bounds? ] unit-test
14 [ f ] [ 2 3 <board> { -1 0 } block-in-bounds? ] unit-test
15 [ t ] [ 2 3 <board> { 1 2 } block-in-bounds? ] unit-test
16 [ f ] [ 2 3 <board> { 2 2 } block-in-bounds? ] unit-test
17 [ t ] [ 2 3 <board> { 1 1 } location-valid? ] unit-test
18 [ f ] [ 2 3 <board> dup { 1 1 } red board-set-block { 1 1 } location-valid? ] unit-test
19 [ t ] [ 10 10 <board> 10 <random-piece> piece-valid? ] unit-test
20 [ f ] [ 2 3 <board> 10 <random-piece> { 1 2 } over set-piece-location piece-valid? ] unit-test
21 [ { { f } { f } } ] [ 1 1 <board> dup add-row board-rows ] unit-test
22 [ { { f } } ] [ 1 2 <board> dup { 0 1 } red board-set-block dup remove-full-rows board-rows ] unit-test
23 [ { { f } { f } } ] [ 1 2 <board> dup { 0 1 } red board-set-block dup check-rows drop board-rows ] unit-test