Repository navigation
test: fix zipinfo non-ascii check in test-zlib-zip-interop - #66978
ravi-arnan wants to merge 1 commit into
Conversation
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
|
Hi @ravi-arnan, thanks for working on this! Two things I noticed:
I opened #66979 with a version that keeps the |
Keep UNICODE_SUPPORT guard so macOS skips checking non-ASCII names in zipinfo output, and accept '?' / U+FFFD placeholders on builds with UNICODE_SUPPORT that filter non-ASCII bytes in fnfilter() without wide-character printing support (such as NixOS or Gentoo). Fixes: nodejs#66975 Signed-off-by: Ravi Arnan <[email protected]>
288cb78 to
d64e99d
Compare
|
Hi @vedchaudhari, thanks for the review and for catching the macOS behavior! I reproduced and verified this directly on a physical macOS machine (Darwin 21.6.0, built-in Info-ZIP 6.0). As you noted:
I have updated this PR to:
Linter and test assertions are verified clean. |
Fixes: #66975
Problem
In
test/parallel/test-zlib-zip-interop.js,zipinfoUnicodeis evaluated as/UNICODE_SUPPORT/.test(unzip -v). However, stock Info-ZIP builds (common on Linux distros such as NixOS, Arch Linux, Alpine, and Debian) still sanitize non-ASCII bytes to'?'infnfilter()unless patched with wide-character/UTF-8 printing support (e.g.USE_NATSPECoralt-iconv-utf8-print).On these systems,
zipinfooutputsunicode-??.txt(orunicode-??????.txt) instead ofunicode-εε.txt, which causes the assertion:to fail.
Solution
When checking
zipinfooutput:zipinfolisted the entry with'?'placeholders.The actual UTF-8 decoding and round-trip extraction continue to be verified by
bsdtardirectly afterwards.Verification
node tools/eslint/node_modules/eslint/bin/eslint.js test/parallel/test-zlib-zip-interop.js(clean, 0 warnings/errors).zipinfoexecution on Linux (NixOS) where stock Info-ZIP printsunicode-??.txt(clean pass).