Skip to content

test: make a test path-independent

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test, child_process

This is the first step to fix the #12773 (closed).

I've decided to start from the most whimsical one (section 4 in the #12773 (closed)): parallel/test-spawn-cmd-named-pipe.js fails if spaces exist both in node.exe and the test paths. If there are no spaces or there are spaces only in one of the paths (either), the test passes.

If I get it right, the cause is the very complicated rules for cmd.exe command line syntax concerning spaces and quotes: see "Quote Characters in a command" here and "Examples:" here.

The fixed test passes with all 4 paths variants (spaceless + spaceless, spacy + spaceless, spaceless + spacy, and spacy + spacy).

Please, test in more environments and propose better fixes if you have some)

cc @nodejs/testing, @nodejs/platform-windows, @bnoordhuis, @cjihrig

Merge request reports

Loading