mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
Move single or trivial and limited use things out of common/index.js for the purpose of simplifying and reducing common/index.js PR-URL: https://github.com/nodejs/node/pull/56712 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
20 lines
798 B
JavaScript
20 lines
798 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const { readFileSync } = require('fs');
|
|
const { testWasiPreview1 } = require('../common/wasi');
|
|
|
|
const checkoutEOL = readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n';
|
|
|
|
// TODO(@jasnell): It's not entirely clear what this test is asserting.
|
|
// More comments would be helpful.
|
|
|
|
testWasiPreview1(['freopen'], {}, { stdout: `hello from input2.txt${checkoutEOL}` });
|
|
testWasiPreview1(['read_file'], {}, { stdout: `hello from input.txt${checkoutEOL}` });
|
|
testWasiPreview1(['read_file_twice'], {}, {
|
|
stdout: `hello from input.txt${checkoutEOL}hello from input.txt${checkoutEOL}`,
|
|
});
|
|
// Tests that are currently unsupported on Windows.
|
|
if (process.platform !== 'win32') {
|
|
testWasiPreview1(['stdin'], { input: 'hello world' }, { stdout: 'hello world' });
|
|
}
|