All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Orgad and Raizel Shaneh <orgads@gmail.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Subject: [PATCH 9/8] t0060: split absolute path test in two to exercise some of it on Windows
Date: Sun, 09 Sep 2012 17:42:20 +0200	[thread overview]
Message-ID: <504CB8DC.90202@kdbg.org> (raw)
In-Reply-To: <1346971264-23744-1-git-send-email-mhagger@alum.mit.edu>

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>
---
 The series passes for me as is, but one test needs POSIX only in
 the first half. This patch splits it in two.

 t/t0060-path-utils.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index e40f764..4ef2345 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")" &&
-- 
1.7.12.1493.g247bc0e

  parent reply	other threads:[~2012-09-09 15:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 22:40 [PATCH v2 0/8] Fix some bugs in abspath.c Michael Haggerty
2012-09-06 22:40 ` [PATCH v2 1/8] t0060: move tests of real_path() from t0000 to here Michael Haggerty
2012-09-06 22:40 ` [PATCH v2 2/8] t0060: verify that absolute_path() fails if passed the empty string Michael Haggerty
2012-09-06 22:40 ` [PATCH v2 3/8] absolute_path(): reject " Michael Haggerty
2012-09-06 23:09   ` Junio C Hamano
2012-09-09  4:48     ` Michael Haggerty
2012-09-09  4:59       ` Junio C Hamano
2012-09-06 22:41 ` [PATCH v2 4/8] t0060: verify that real_path() fails if passed " Michael Haggerty
2012-09-06 22:41 ` [PATCH v2 5/8] real_path(): reject " Michael Haggerty
2012-09-06 22:41 ` [PATCH v2 6/8] t0060: verify that real_path() works correctly with absolute paths Michael Haggerty
2012-09-06 22:41 ` [PATCH v2 7/8] real_path(): properly handle nonexistent top-level paths Michael Haggerty
2012-09-06 22:41 ` [PATCH v2 8/8] t0060: verify that real_path() removes extra slashes Michael Haggerty
2012-09-09 15:42 ` Johannes Sixt [this message]
2012-09-10 11:52   ` [PATCH 9/8] t0060: split absolute path test in two to exercise some of it on Windows Michael Haggerty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=504CB8DC.90202@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    --cc=orgads@gmail.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.