Re: [PATCH v1 1/1] test: Correct detection of UTF8_NFD_TO_NFC for APFS
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 30, 2018, 07:56 UTC
- Message-ID
- <xmqqvac9xh4d.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180430063519.27122-1-tboegi@web.de>
tboegi@web.de writes:
Show 20 quoted lines
> From: Torsten Bögershausen <tboegi@web.de> > > On HFS (which is the default Mac filesystem prior to High Sierra), > unicode names are "decomposed" before recording. > On APFS, which appears to be the new default filesystem in Mac OS High > Sierra, filenames are recorded as specified by the user. > > APFS continues to allow the user to access it via any name > that normalizes to the same thing. > > This difference causes t0050-filesystem.sh to fail two tests. > > Improve the test for a NFD/NFC in test-lib.sh: > Test if the same file can be reached in pre- and decomposed unicode. > > Reported-By: Elijah Newren <newren@gmail.com> > Signed-off-by: Torsten Bögershausen <tboegi@web.de> > --- > t/test-lib.sh | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-)
Thanks.
Wouldn't it logically make more sense to check for the target being an existing file with "-f"? It is not an essential part of the test for the target to be "readable", but "can be stat(2)ed with the other UTF-8 representation" is.
Show 18 quoted lines
> diff --git a/t/test-lib.sh b/t/test-lib.sh > index ea2bbaaa7a..e206250d1b 100644 > --- a/t/test-lib.sh > +++ b/t/test-lib.sh > @@ -1106,12 +1106,7 @@ test_lazy_prereq UTF8_NFD_TO_NFC ' > auml=$(printf "\303\244") > aumlcdiar=$(printf "\141\314\210") > >"$auml" && > - case "$(echo *)" in > - "$aumlcdiar") > - true ;; > - *) > - false ;; > - esac > + test -r "$aumlcdiar" > ' > > test_lazy_prereq AUTOIDENT '