]> gitweb.factorcode.org Git - factor.git/blob - core/arrays/arrays-tests.factor
Fix permission bits
[factor.git] / core / arrays / arrays-tests.factor
1 USING: accessors arrays kernel sequences sequences.private growable
2 tools.test vectors layouts system math vectors.private ;
3 IN: arrays.tests
4
5 [ -2 { "a" "b" "c" } nth ] must-fail
6 [ 10 { "a" "b" "c" } nth ] must-fail
7 [ "hi" -2 { "a" "b" "c" } set-nth ] must-fail
8 [ "hi" 10 { "a" "b" "c" } set-nth ] must-fail
9 [ f ] [ { "a" "b" "c" } dup clone eq? ] unit-test
10 [ "hi" ] [ "hi" 1 { "a" "b" "c" } clone [ set-nth ] keep second ] unit-test
11 [ V{ "a" "b" "c" } ] [ { "a" "b" "c" } >vector ] unit-test
12 [ f ] [ { "a" "b" "c" } dup >array eq? ] unit-test
13 [ t ] [ { "a" "b" "c" } dup { } like eq? ] unit-test
14 [ t ] [ { "a" "b" "c" } dup dup length vector boa underlying>> eq? ] unit-test
15 [ V{ "a" "b" "c" } ] [ { "a" "b" "c" } V{ } like ] unit-test
16 [ { "a" "b" "c" } ] [ { "a" } { "b" "c" } append ] unit-test
17 [ { "a" "b" "c" "d" "e" } ]
18 [ { "a" } { "b" "c" } { "d" "e" } 3append ] unit-test
19
20 [ -1 f <array> ] must-fail
21 [ cell-bits cell log2 - 2^ f <array> ] must-fail