]> gitweb.factorcode.org Git - factor.git/commitdiff
Revert "make io.pathnames tests path-separator-neutral"
authorJoe Groff <arcata@gmail.com>
Thu, 18 Feb 2010 00:06:13 +0000 (16:06 -0800)
committerJoe Groff <arcata@gmail.com>
Thu, 18 Feb 2010 00:06:13 +0000 (16:06 -0800)
This reverts commit f344c0062966a8c7ff9a9c8e57d06316941f8c12.

core/io/pathnames/pathnames-tests.factor

index 38cfe330fb513cdcc6083e35671993aed077cc73..f23a1ac1f4f9856ea876d6b59baeae8aee8a6f76 100644 (file)
@@ -1,6 +1,6 @@
 USING: io.pathnames io.files.temp io.directories
 continuations math io.files.private kernel
-namespaces sequences tools.test io.pathnames.private ;
+namespaces tools.test io.pathnames.private ;
 IN: io.pathnames.tests
 
 [ "passwd" ] [ "/etc/passwd" file-name ] unit-test
@@ -11,23 +11,20 @@ IN: io.pathnames.tests
 [ "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
+[ "/usr/lib" ] [ "/usr" "lib" append-path ] unit-test
+[ "/usr/lib" ] [ "/usr/" "lib" append-path ] unit-test
+[ "/usr/lib" ] [ "/usr" "./lib" append-path ] unit-test
+[ "/usr/lib/" ] [ "/usr" "./lib/" append-path ] unit-test
+[ "/lib" ] [ "/usr" "../lib" append-path ] unit-test
+[ "/lib/" ] [ "/usr" "../lib/" append-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
+[ "/" ] [ "/" "./." append-path ] unit-test
+[ "/" ] [ "/" "././" append-path ] unit-test
+[ "/a/b/lib" ] [ "/a/b/c/d/e/f/" "../../../../lib" append-path ] unit-test
+[ "/a/b/lib/" ] [ "/a/b/c/d/e/f/" "../../../../lib/" append-path ] unit-test
 
 [ "" "../lib/" append-path ] must-fail
 [ "lib" ] [ "" "lib" append-path ] unit-test
@@ -48,10 +45,10 @@ IN: io.pathnames.tests
 [ "" parent-directory ] must-fail
 [ "." ] [ "boot.x86.64.image" parent-directory ] 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
+[ "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
 
 [ t ] [ "resource:core" absolute-path? ] unit-test
 [ f ] [ "" absolute-path? ] unit-test
@@ -64,7 +61,7 @@ IN: io.pathnames.tests
     "." current-directory set
     ".." "resource-path" set
     [ "../core/bootstrap/stage2.factor" ]
-    [ "resource:core/bootstrap/stage2.factor" absolute-path >test-path ]
+    [ "resource:core/bootstrap/stage2.factor" absolute-path ]
     unit-test
 ] with-scope