Skip to content

Commit bacca78

Browse files
j6tgitster
authored andcommitted
t0060: split absolute path test in two to exercise some of it on Windows
Only the first half of the test works only on POSIX, the second half passes on Windows as well. A later test "real path removes other extra slashes" looks very similar, but it does not make sense to split it in the same way: When two slashes are prepended in front of an absolute DOS-style path on Windows, the meaning of the path is changed (//server/share style), so that the test cannot pass on Windows. Signed-off-by: Johannes Sixt <[email protected]> Acked-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 379a03a commit bacca78

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

t/t0060-path-utils.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,14 @@ test_expect_success 'real path rejects the empty string' '
148148
test_must_fail test-path-utils real_path ""
149149
'
150150

151-
test_expect_success POSIX 'real path works on absolute paths' '
151+
test_expect_success POSIX 'real path works on absolute paths 1' '
152152
nopath="hopefully-absent-path" &&
153153
test "/" = "$(test-path-utils real_path "/")" &&
154-
test "/$nopath" = "$(test-path-utils real_path "/$nopath")" &&
154+
test "/$nopath" = "$(test-path-utils real_path "/$nopath")"
155+
'
156+
157+
test_expect_success 'real path works on absolute paths 2' '
158+
nopath="hopefully-absent-path" &&
155159
# Find an existing top-level directory for the remaining tests:
156160
d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
157161
test "$d" = "$(test-path-utils real_path "$d")" &&

0 commit comments

Comments
 (0)