Re: [PATCH v6 26/28] t/lib-unicode-nfc-nfd: helper prereqs for testing unicode nfc/nfd
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- May 17, 2022, 21:14 UTC
- Message-ID
- <adaffdd2-9294-0ddb-5eac-d8b90ae13f20@jeffhostetler.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2205121711300.352@tvgsbejvaqbjf.bet>
On 5/12/22 11:26 AM, Johannes Schindelin wrote:
Show 6 quoted lines
> Hi Jeff, > > On Fri, 22 Apr 2022, Jeff Hostetler via GitGitGadget wrote: > >> From: Jeff Hostetler <jeffhost@microsoft.com> >>
[...]
Show 28 quoted lines
>> +#
>> +test_lazy_prereq UNICODE_NFC_PRESERVED '
>> + mkdir c_${utf8_nfc} &&
>> + ls | od -t x1 | grep "63 *5f *c3 *a9"
>
> As far as I can see, this would be the first usage of `od` in the test
> suite. I'd actually like to reduce our dependency on Unix-y tools, not
> increase it.
>
> One thing we could do would be to imitate t4030, and introduce a shell
> function that calls Perl, something like:
>
> bin2hex () {
> perl -e '
> $/ = undef;
> $_ = <>;
> s/./sprintf("%02x ", ord($&))/ge;
> print $_
> '
> }
>
> But it is a thorn in my side for quite a few years already that we
> _require_ Perl, even in NO_PERL builds.
>
> So maybe a much better idea would be to introduce a small helper in
> `t/helper/` that converts binary data on stdin to hex on stdout? Something
> like this:
> Yeah, lets add the hexdump helper.
Thanks Jeff