From: Jeff Hostetler Date: Tue, 17 May 2022 21:14:11 GMT Subject: Re: [PATCH v6 26/28] t/lib-unicode-nfc-nfd: helper prereqs for testing unicode nfc/nfd Message-ID: In-Reply-To: On 5/12/22 11:26 AM, Johannes Schindelin wrote: > Hi Jeff, > > On Fri, 22 Apr 2022, Jeff Hostetler via GitGitGadget wrote: > >> From: Jeff Hostetler >> [...] >> +# >> +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