Subject: Re: [PATCH v2 1/3] test: use unambigous leading path (/foo) for mingw

From: Junio C Hamano <[email-masked]>
Date: Fri, 13 Sep 2013 12:51:04 -0700

Jiang Xin <[email-masked]> writes:

> 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 doc drive on MINGW platform. Use an umambigous leading path
> "/foo" instead.

"DOS drive", you mean?

Are they really spelled as /a or /x (not e.g. //a or something)?

Just double-checking.

> Signed-off-by: Jiang Xin <[email-masked]>
> ---
>  t/t0060-path-utils.sh | 56 +++++++++++++++++++++++++--------------------------
>  1 file changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
> index 3a48de2..82a6f21 100755
> --- a/t/t0060-path-utils.sh
> +++ b/t/t0060-path-utils.sh
> @@ -190,33 +190,33 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
>  	test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
>  '
>  
> -relative_path /a/b/c/	/a/b/		c/
> -relative_path /a/b/c/	/a/b		c/
> -relative_path /a//b//c/	//a/b//		c/	POSIX
> -relative_path /a/b	/a/b		./
> -relative_path /a/b/	/a/b		./
> -relative_path /a	/a/b		../
> -relative_path /		/a/b/		../../
> -relative_path /a/c	/a/b/		../c
> -relative_path /a/c	/a/b		../c
> -relative_path /x/y	/a/b/		../../x/y
> -relative_path /a/b	"<empty>"	/a/b
> -relative_path /a/b 	"<null>"	/a/b
> -relative_path a/b/c/	a/b/		c/
> -relative_path a/b/c/	a/b		c/
> -relative_path a/b//c	a//b		c
> -relative_path a/b/	a/b/		./
> -relative_path a/b/	a/b		./
> -relative_path a		a/b		../
> -relative_path x/y	a/b		../../x/y
> -relative_path a/c	a/b		../c
> -relative_path a/b	"<empty>"	a/b
> -relative_path a/b 	"<null>"	a/b
> -relative_path "<empty>"	/a/b		./
> -relative_path "<empty>"	"<empty>"	./
> -relative_path "<empty>"	"<null>"	./
> -relative_path "<null>"	"<empty>"	./
> -relative_path "<null>"	"<null>"	./
> -relative_path "<null>"	/a/b		./
> +relative_path /foo/a/b/c/	/foo/a/b/	c/
> +relative_path /foo/a/b/c/	/foo/a/b	c/
> +relative_path /foo/a//b//c/	//foo/a/b//	c/		POSIX
> +relative_path /foo/a/b		/foo/a/b	./
> +relative_path /foo/a/b/		/foo/a/b	./
> +relative_path /foo/a		/foo/a/b	../
> +relative_path /			/foo/a/b/	../../../
> +relative_path /foo/a/c		/foo/a/b/	../c
> +relative_path /foo/a/c		/foo/a/b	../c
> +relative_path /foo/x/y		/foo/a/b/	../../x/y
> +relative_path /foo/a/b		"<empty>"	/foo/a/b
> +relative_path /foo/a/b 		"<null>"	/foo/a/b
> +relative_path foo/a/b/c/	foo/a/b/	c/
> +relative_path foo/a/b/c/	foo/a/b		c/
> +relative_path foo/a/b//c	foo/a//b	c
> +relative_path foo/a/b/		foo/a/b/	./
> +relative_path foo/a/b/		foo/a/b		./
> +relative_path foo/a		foo/a/b		../
> +relative_path foo/x/y		foo/a/b		../../x/y
> +relative_path foo/a/c		foo/a/b		../c
> +relative_path foo/a/b		"<empty>"	foo/a/b
> +relative_path foo/a/b 		"<null>"	foo/a/b
> +relative_path "<empty>"		/foo/a/b	./
> +relative_path "<empty>"		"<empty>"	./
> +relative_path "<empty>"		"<null>"	./
> +relative_path "<null>"		"<empty>"	./
> +relative_path "<null>"		"<null>"	./
> +relative_path "<null>"		/foo/a/b	./
>  
>  test_done