Skip to content

Commit daf19a8

Browse files
jiangxinjrn
authored andcommitted
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>
1 parent f85f794 commit daf19a8

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

t/t0060-path-utils.sh

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -190,33 +190,33 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
190190
test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
191191
'
192192

193-
relative_path /a/b/c/ /a/b/ c/
194-
relative_path /a/b/c/ /a/b c/
195-
relative_path /a//b//c/ //a/b// c/ POSIX
196-
relative_path /a/b /a/b ./
197-
relative_path /a/b/ /a/b ./
198-
relative_path /a /a/b ../
199-
relative_path / /a/b/ ../../
200-
relative_path /a/c /a/b/ ../c
201-
relative_path /a/c /a/b ../c
202-
relative_path /x/y /a/b/ ../../x/y
203-
relative_path /a/b "<empty>" /a/b
204-
relative_path /a/b "<null>" /a/b
205-
relative_path a/b/c/ a/b/ c/
206-
relative_path a/b/c/ a/b c/
207-
relative_path a/b//c a//b c
208-
relative_path a/b/ a/b/ ./
209-
relative_path a/b/ a/b ./
210-
relative_path a a/b ../
211-
relative_path x/y a/b ../../x/y
212-
relative_path a/c a/b ../c
213-
relative_path a/b "<empty>" a/b
214-
relative_path a/b "<null>" a/b
215-
relative_path "<empty>" /a/b ./
216-
relative_path "<empty>" "<empty>" ./
217-
relative_path "<empty>" "<null>" ./
218-
relative_path "<null>" "<empty>" ./
219-
relative_path "<null>" "<null>" ./
220-
relative_path "<null>" /a/b ./
193+
relative_path /foo/a/b/c/ /foo/a/b/ c/
194+
relative_path /foo/a/b/c/ /foo/a/b c/
195+
relative_path /foo/a//b//c/ ///foo/a/b// c/ POSIX
196+
relative_path /foo/a/b /foo/a/b ./
197+
relative_path /foo/a/b/ /foo/a/b ./
198+
relative_path /foo/a /foo/a/b ../
199+
relative_path / /foo/a/b/ ../../../
200+
relative_path /foo/a/c /foo/a/b/ ../c
201+
relative_path /foo/a/c /foo/a/b ../c
202+
relative_path /foo/x/y /foo/a/b/ ../../x/y
203+
relative_path /foo/a/b "<empty>" /foo/a/b
204+
relative_path /foo/a/b "<null>" /foo/a/b
205+
relative_path foo/a/b/c/ foo/a/b/ c/
206+
relative_path foo/a/b/c/ foo/a/b c/
207+
relative_path foo/a/b//c foo/a//b c
208+
relative_path foo/a/b/ foo/a/b/ ./
209+
relative_path foo/a/b/ foo/a/b ./
210+
relative_path foo/a foo/a/b ../
211+
relative_path foo/x/y foo/a/b ../../x/y
212+
relative_path foo/a/c foo/a/b ../c
213+
relative_path foo/a/b "<empty>" foo/a/b
214+
relative_path foo/a/b "<null>" foo/a/b
215+
relative_path "<empty>" /foo/a/b ./
216+
relative_path "<empty>" "<empty>" ./
217+
relative_path "<empty>" "<null>" ./
218+
relative_path "<null>" "<empty>" ./
219+
relative_path "<null>" "<null>" ./
220+
relative_path "<null>" /foo/a/b ./
221221

222222
test_done

0 commit comments

Comments
 (0)