There are two Node.js scripts:
- print.js writes symbol
0
to stdout N times throughprocess.stdout.write
and immediately finishes callingprocess.exit(0)
- test.js reads stdin and checks that N symbols has been received before exit
Test should be failed on Windows with node < v0.11.12.
> nvm install 0.11.11
> nvm use 0.11.11
> node print | node test
Test failed! Received 132 symbols, but 10000 expected!
And should be completed since node >= v0.11.12.
> nvm install 0.11.12
> nvm use 0.11.12
> node print | node test
Test completed!
See nodejs v0.11.12 (2014.03.11) changelog: windows: make stdout/sterr pipes blocking (Alexis Campailla)