On 05/01/2026 00:54, Collin Funk wrote:
* init.cfg (bad_unicode): New function, copied from
tests/fold/fold-characters.sh with the NUL removed.
* tests/fold/fold-characters.sh (bad_unicode): Rename to
bad_unicode_with_nul. Reformat long line.
* tests/mktemp/bad-unicode.sh: New test.
* tests/local.mk (all_tests): Add the new test.

There were a few issues with this:

It's actually creating files, and theoretically some file systems
may reject the bad unicode, which would induce a false failure.

Also it's better to use a cleanup_() function to remove files etc.
to handle the case where a test is terminated early.

Both the above issues can be avoided by passing -u to mktemp,
so that it only does internal processing.

There were typos with --tempdir and test -z.

The tests/misc/mktemp.pl should be moved to
the tests/mktemp dir as part of this.

I've attached the updated test I was checking with.

cheers,
Padraig

Attachment: bad-unicode.sh
Description: application/shellscript

Reply via email to