Re: [PATCH v4 4/4] t0060: verify that basename() and dirname() work as expected

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v4 4/4] t0060: verify that basename() and dirname() work as expected

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:07:43

Hi Torsten,

On Wed, 13 Jan 2016, Torsten Bögershausen wrote:
On 01/12/2016 08:57 AM, Johannes Schindelin wrote:
quoted
+static struct test_data basename_data[] = {
+	/* --- POSIX type paths --- */
+	{ NULL,              "."    },
+	{ "",                "."    },
+	{ ".",               "."    },
+	{ "..",              ".."   },
+	{ "/",               "/"    },
+#if defined(__CYGWIN__) && !defined(NO_LIBGEN_H)
Why the !defined(NO_LIBGEN_H)

Shouldn't CYGWIN always behave the same ?
One would assume... Alas, it does not.

I inherited the code in question and wondered the same. I opted for
keeping the code as a documentation of the differing behavior.
The main problem is, that t0060 fails under Mac OS (with mac ports
installed):
expecting success: test-path-utils dirname
error: FAIL: dirname(//) => '/' != '//'
See the patch I sent this morning.

Ciao,
Dscho

Re: [PATCH v4 4/4] t0060: verify that basename() and dirname() work as expected

From: Ramsay Jones <hidden>
Date: 2016-06-15 23:07:44


On 13/01/16 09:27, Johannes Schindelin wrote:
Hi Torsten,

On Wed, 13 Jan 2016, Torsten Bögershausen wrote:
quoted
On 01/12/2016 08:57 AM, Johannes Schindelin wrote:
quoted
+static struct test_data basename_data[] = {
+	/* --- POSIX type paths --- */
+	{ NULL,              "."    },
+	{ "",                "."    },
+	{ ".",               "."    },
+	{ "..",              ".."   },
+	{ "/",               "/"    },
+#if defined(__CYGWIN__) && !defined(NO_LIBGEN_H)
Why the !defined(NO_LIBGEN_H)

Shouldn't CYGWIN always behave the same ?
One would assume... Alas, it does not.
Err, ... yes it does! :-P
I inherited the code in question and wondered the same. I opted for
keeping the code as a documentation of the differing behavior.
Exactly.

ATB,
Ramsay Jones
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help