]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test: use unambigous leading path (/foo) for MSYS
authorJiang Xin <worldhello.net@gmail.com>
Mon, 14 Oct 2013 02:29:38 +0000 (10:29 +0800)
committerJonathan Nieder <jrnieder@gmail.com>
Mon, 14 Oct 2013 14:00:01 +0000 (07:00 -0700)
In test cases for relative_path, path with one leading character
(such as /a, /x) may be recogonized as "a:/" or "x:/" if there is
such DOS drive on MSYS platform. Use an umambigous leading path
"/foo" instead.

Also change two leading slashes (//) to three leading slashes (///),
otherwize it will be recognized as UNC name on MSYS platform.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
t/t0060-path-utils.sh

index 3a48de20d8e0d63a6901cb8df037805e97c5c3f3..92976e0402ff5cd017accc604243a2a50b54bc29 100755 (executable)
@@ -190,33 +190,33 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
        test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
 '
 
-relative_path /a/b/c/  /a/b/           c/
-relative_path /a/b/c/  /a/b            c/
-relative_path /a//b//c/        //a/b//         c/      POSIX
-relative_path /a/b     /a/b            ./
-relative_path /a/b/    /a/b            ./
-relative_path /a       /a/b            ../
-relative_path /                /a/b/           ../../
-relative_path /a/c     /a/b/           ../c
-relative_path /a/c     /a/b            ../c
-relative_path /x/y     /a/b/           ../../x/y
-relative_path /a/b     "<empty>"       /a/b
-relative_path /a/b     "<null>"        /a/b
-relative_path a/b/c/   a/b/            c/
-relative_path a/b/c/   a/b             c/
-relative_path a/b//c   a//b            c
-relative_path a/b/     a/b/            ./
-relative_path a/b/     a/b             ./
-relative_path a                a/b             ../
-relative_path x/y      a/b             ../../x/y
-relative_path a/c      a/b             ../c
-relative_path a/b      "<empty>"       a/b
-relative_path a/b      "<null>"        a/b
-relative_path "<empty>"        /a/b            ./
-relative_path "<empty>"        "<empty>"       ./
-relative_path "<empty>"        "<null>"        ./
-relative_path "<null>" "<empty>"       ./
-relative_path "<null>" "<null>"        ./
-relative_path "<null>" /a/b            ./
+relative_path /foo/a/b/c/      /foo/a/b/       c/
+relative_path /foo/a/b/c/      /foo/a/b        c/
+relative_path /foo/a//b//c/    ///foo/a/b//    c/              POSIX
+relative_path /foo/a/b         /foo/a/b        ./
+relative_path /foo/a/b/                /foo/a/b        ./
+relative_path /foo/a           /foo/a/b        ../
+relative_path /                        /foo/a/b/       ../../../
+relative_path /foo/a/c         /foo/a/b/       ../c
+relative_path /foo/a/c         /foo/a/b        ../c
+relative_path /foo/x/y         /foo/a/b/       ../../x/y
+relative_path /foo/a/b         "<empty>"       /foo/a/b
+relative_path /foo/a/b                 "<null>"        /foo/a/b
+relative_path foo/a/b/c/       foo/a/b/        c/
+relative_path foo/a/b/c/       foo/a/b         c/
+relative_path foo/a/b//c       foo/a//b        c
+relative_path foo/a/b/         foo/a/b/        ./
+relative_path foo/a/b/         foo/a/b         ./
+relative_path foo/a            foo/a/b         ../
+relative_path foo/x/y          foo/a/b         ../../x/y
+relative_path foo/a/c          foo/a/b         ../c
+relative_path foo/a/b          "<empty>"       foo/a/b
+relative_path foo/a/b          "<null>"        foo/a/b
+relative_path "<empty>"                /foo/a/b        ./
+relative_path "<empty>"                "<empty>"       ./
+relative_path "<empty>"                "<null>"        ./
+relative_path "<null>"         "<empty>"       ./
+relative_path "<null>"         "<null>"        ./
+relative_path "<null>"         /foo/a/b        ./
 
 test_done