forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: nodejs#56712 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
- Loading branch information
1 parent
4a5d2c7
commit 0713ee3
Showing
6 changed files
with
19 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const { checkoutEOL } = common; | ||
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 (!common.isWindows) { | ||
if (process.platform !== 'win32') { | ||
testWasiPreview1(['stdin'], { input: 'hello world' }, { stdout: 'hello world' }); | ||
} |