test\parallel\test-child-process-stdin.js uses more command and does not expect any error messages in the stderr (see common.mustNotCall()).
However, some core Windows shell commands work wrong with Unicode shell codepage. See this answer.
To check more command:
chcp 65001 && more
Active code page: 65001
Not enough memory.
chcp 1252 && more
Active code page: 1252
[reading from stdio]
To check test\parallel\test-child-process-stdin.js pass:
chcp 65001 && node test\parallel\test-child-process-stdin.js
Active code page: 65001
... AssertionError: function should not have been called ...
chcp 1252 && node test\parallel\test-child-process-stdin.js
Active code page: 1252
stdout: hello world
It seems the same with these two tests:
test\parallel\test-child-process-spawn-shell.js calls more here.
test\parallel\test-child-process-spawnsync-shell.js calls more here.
The same checks:
chcp 65001 && node test\parallel\test-child-process-spawnsync-shell.js
... AssertionError: '' === 'bar' ...
chcp 1252 && node test\parallel\test-child-process-spawnsync-shell.js
[pass]
chcp 65001 && node test\parallel\test-child-process-spawn-shell.js
... AssertionError: '' === 'bar' ...
chcp 1252 && node test\parallel\test-child-process-spawn-shell.js
[pass]
So I guess it should be documented that tests should be run in a non-Unicode codepage.
Or maybe the test runner (or a concerned test / common lib) should set an appropriate codepage before a run.
I can reproduce this on Windows 7 and 2008R2 but cannot on Windows Server 2012R2. So, this looks like an issue with more (that ships with Windows: C:\Windows\System32\more.com) that has been fixed on Windows 8/2012.
I suspect more is used just because it was never changed to cat, we already require cat (installed by git) to run the tests. I'd be happy to discuss a PR to s/more/cat/, if it works.
I can't reproduce this on Windows 8.1 (6.3.9600). chcp 65001 && more works just fine. Changing to cat SGTM.
@vsemozhetbyt do you want to submit a PR for this?
@TimothyGu If @joaocgreis has no plans to do this, I can try. However, I am not good at *nix shell tools so I can overlook something.
I've added this to my queue, but I'm not likely to get there soon. Feel free to go ahead, I can help review.
@joaocgreis The PR, PTAL.
Most helpful comment
I can reproduce this on Windows 7 and 2008R2 but cannot on Windows Server 2012R2. So, this looks like an issue with
more(that ships with Windows:C:\Windows\System32\more.com) that has been fixed on Windows 8/2012.I suspect
moreis used just because it was never changed tocat, we already requirecat(installed by git) to run the tests. I'd be happy to discuss a PR tos/more/cat/, if it works.