diff options
author | Johannes Sixt <j6t@kdbg.org> | 2012-09-09 17:42:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-10 09:31:44 -0700 |
commit | bacca7852f2f304ebe3f579de1a6cf0152af3df1 (patch) | |
tree | 4d139f96cd833c362cdc5bc3d292baf003bb3167 /t/t0060-path-utils.sh | |
parent | 379a03ad8194192ab7b2910ec3326a981971fda1 (diff) | |
download | git-bacca7852f2f304ebe3f579de1a6cf0152af3df1.tar.gz |
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 <j6t@kdbg.org>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0060-path-utils.sh')
-rwxr-xr-x | t/t0060-path-utils.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index e40f764d54..4ef2345982 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -148,10 +148,14 @@ test_expect_success 'real path rejects the empty string' ' test_must_fail test-path-utils real_path "" ' -test_expect_success POSIX 'real path works on absolute paths' ' +test_expect_success POSIX 'real path works on absolute paths 1' ' nopath="hopefully-absent-path" && test "/" = "$(test-path-utils real_path "/")" && - test "/$nopath" = "$(test-path-utils real_path "/$nopath")" && + test "/$nopath" = "$(test-path-utils real_path "/$nopath")" +' + +test_expect_success 'real path works on absolute paths 2' ' + nopath="hopefully-absent-path" && # Find an existing top-level directory for the remaining tests: d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") && test "$d" = "$(test-path-utils real_path "$d")" && |