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>
Jiang Xin committed
Oct 14, 2013 at 10:29 UTC
daf19a80fa6b7402f8a2efa8f8255b4b5d6b48a9
1 file changed
+28
-28
t/t0060-path-utils.sh
+28
-28
@@ -190,33 +190,33 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
190
test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
191
'
192
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 ./
221
222
test_done