1 USING: accessors arrays kernel kernel.private layouts literals math
2 sequences tools.test vectors ;
4 [ -2 { "a" "b" "c" } nth ] must-fail
5 [ 10 { "a" "b" "c" } nth ] must-fail
6 [ "hi" -2 { "a" "b" "c" } set-nth ] must-fail
7 [ "hi" 10 { "a" "b" "c" } set-nth ] must-fail
8 { f } [ { "a" "b" "c" } dup clone eq? ] unit-test
9 { "hi" } [ "hi" 1 { "a" "b" "c" } clone [ set-nth ] keep second ] unit-test
10 { V{ "a" "b" "c" } } [ { "a" "b" "c" } >vector ] unit-test
11 { f } [ { "a" "b" "c" } dup >array eq? ] unit-test
12 { t } [ { "a" "b" "c" } dup { } like eq? ] unit-test
13 { t } [ { "a" "b" "c" } dup dup length vector boa underlying>> eq? ] unit-test
14 { V{ "a" "b" "c" } } [ { "a" "b" "c" } V{ } like ] unit-test
15 { { "a" "b" "c" } } [ { "a" } { "b" "c" } append ] unit-test
16 { { "a" "b" "c" "d" "e" } }
17 [ { "a" } { "b" "c" } { "d" "e" } 3append ] unit-test
19 [ -1 f <array> ] must-fail
20 [ cell-bits cell log2 - 2^ f <array> ] must-fail
21 ! To big for a fixnum #1045
23 ${ KERNEL-ERROR ERROR-OUT-OF-FIXNUM-RANGE 147573952589676412928 f }