]> gitweb.factorcode.org Git - factor.git/blob - basis/io/unix/files/files-tests.factor
040b191d27bfb5ddefd63e5b70fcedeae8afb24d
[factor.git] / basis / io / unix / files / files-tests.factor
1 USING: tools.test io.files ;
2 IN: io.unix.files.tests
3
4 [ "/usr/libexec/" ] [ "/usr/libexec/awk/" parent-directory ] unit-test
5 [ "/etc/" ] [ "/etc/passwd" parent-directory ] unit-test
6 [ "/" ] [ "/etc/" parent-directory ] unit-test
7 [ "/" ] [ "/etc" parent-directory ] unit-test
8 [ "/" ] [ "/" parent-directory ] unit-test
9
10 [ f ] [ "" root-directory? ] unit-test
11 [ t ] [ "/" root-directory? ] unit-test
12 [ t ] [ "//" root-directory? ] unit-test
13 [ t ] [ "///////" root-directory? ] unit-test
14
15 [ "/" ] [ "/" file-name ] unit-test
16 [ "///" ] [ "///" file-name ] unit-test
17
18 [ "/" ] [ "/" "../.." append-path ] unit-test
19 [ "/" ] [ "/" "../../" append-path ] unit-test
20 [ "/lib" ] [ "/" "../lib" append-path ] unit-test
21 [ "/lib/" ] [ "/" "../lib/" append-path ] unit-test
22 [ "/lib" ] [ "/" "../../lib" append-path ] unit-test
23 [ "/lib/" ] [ "/" "../../lib/" append-path ] unit-test
24
25 [ "/lib" ] [ "/usr/" "/lib" append-path ] unit-test
26 [ "/lib/" ] [ "/usr/" "/lib/" append-path ] unit-test
27 [ "/lib/bux" ] [ "/usr" "/lib/bux" append-path ] unit-test
28 [ "/lib/bux/" ] [ "/usr" "/lib/bux/" append-path ] unit-test
29 [ t ] [ "/foo" absolute-path? ] unit-test