 [ "" parent-directory ] must-fail
 [ "." ] [ "boot.x86.64.image" parent-directory ] unit-test
 
-[ "bar/foo" ] [ "bar/baz" "..///foo" append-path ] unit-test
-[ "bar/baz/foo" ] [ "bar/baz" ".///foo" append-path ] unit-test
-[ "bar/foo" ] [ "bar/baz" "./..//foo" append-path ] unit-test
-[ "bar/foo" ] [ "bar/baz" "./../././././././///foo" append-path ] unit-test
+[ "bar/foo" ] [ "bar/baz" "..///foo" append-path >test-path ] unit-test
+[ "bar/baz/foo" ] [ "bar/baz" ".///foo" append-path >test-path ] unit-test
+[ "bar/foo" ] [ "bar/baz" "./..//foo" append-path >test-path ] unit-test
+[ "bar/foo" ] [ "bar/baz" "./../././././././///foo" append-path >test-path ] unit-test
 
 [ t ] [ "resource:core" absolute-path? ] unit-test
 [ f ] [ "" absolute-path? ] unit-test

    "." current-directory set
    ".." "resource-path" set
    [ "../core/bootstrap/stage2.factor" ]
    [ "resource:core/bootstrap/stage2.factor" absolute-path ]
    unit-test
] with-scope


[ "freetype6.dll" ] [ "resource:freetype6.dll" file-name ] unit-test
[ "freetype6.dll" ] [ "resource:/freetype6.dll" file-name ] unit-test

: >test-path ( path -- path' )
    [ dup path-separator? [ drop CHAR: / ] when ] map ;

[ "/usr/lib" ] [ "/usr" "lib" append-path >test-path ] unit-test
[ "/usr/lib" ] [ "/usr/" "lib" append-path >test-path ] unit-test
[ "/usr/lib" ] [ "/usr" "./lib" append-path >test-path ] unit-test
[ "/usr/lib/" ] [ "/usr" "./lib/" append-path >test-path ] unit-test
[ "/lib" ] [ "/usr" "../lib" append-path >test-path ] unit-test
[ "/lib/" ] [ "/usr" "../lib/" append-path >test-path ] unit-test

[ "" ] [ "" "." append-path ] unit-test
[ "" ".." append-path ] must-fail

[ "/" ] [ "/" "./." append-path >test-path ] unit-test
[ "/" ] [ "/" "././" append-path >test-path ] unit-test
[ "/a/b/lib" ] [ "/a/b/c/d/e/f/" "../../../../lib" append-path >test-path ] unit-test
[ "/a/b/lib/" ] [ "/a/b/c/d/e/f/" "../../../../lib/" append-path >test-path ] unit-test

[ "" "../lib/" append-path ] must-fail
[ "lib" ] [ "" "lib" append-path ] unit-test
