test: use unambigous leading path (/foo) for MSYS

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>
This commit is contained in:
Jiang Xin 2013-10-14 10:29:38 +08:00 committed by Jonathan Nieder
parent f85f7947c3
commit daf19a80fa

View File

@ -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 /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>" /a/b ./
relative_path "<null>" /foo/a/b ./
test_done