1 USING: trees assocs tools.test kernel sequences ;
4 : test-tree ( -- tree )
10 { 7 "replaced seven" }
13 ! test set-at, at, at*
14 [ "seven" ] [ <tree> "seven" 7 pick set-at 7 swap at ] unit-test
15 [ "seven" t ] [ <tree> "seven" 7 pick set-at 7 swap at* ] unit-test
16 [ f f ] [ <tree> "seven" 7 pick set-at 8 swap at* ] unit-test
17 [ "seven" ] [ <tree> "seven" 7 pick set-at 7 swap at ] unit-test
18 [ "replacement" ] [ <tree> "seven" 7 pick set-at "replacement" 7 pick set-at 7 swap at ] unit-test
19 [ "replaced four" ] [ test-tree 4 swap at ] unit-test
20 [ "nine" ] [ test-tree 9 swap at ] unit-test
23 [ f ] [ test-tree 9 over delete-at 9 swap at ] unit-test
24 [ "replaced seven" ] [ test-tree 9 over delete-at 7 swap at ] unit-test
25 [ "replaced four" ] [ test-tree 9 over delete-at 4 swap at ] unit-test
26 [ "nine" "replaced four" ] [ test-tree 7 over delete-at 9 over at 4 rot at ] unit-test
27 [ "nine" ] [ test-tree 7 over delete-at 4 over delete-at 9 swap at ] unit-test