mirror of
https://github.com/antonmedv/fx.git
synced 2024-08-17 06:00:32 +03:00
Check for long arg file names
This commit is contained in:
parent
e465f7d2c8
commit
44e7388d8e
@ -272,8 +272,12 @@ async function read(fd = 0) {
|
||||
}
|
||||
|
||||
function isFile(fs, path) {
|
||||
try {
|
||||
const stat = fs.statSync(path, {throwIfNoEntry: false})
|
||||
return stat !== undefined && stat.isFile()
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function sleepSync(ms) {
|
||||
|
@ -221,4 +221,10 @@ void async function main() {
|
||||
const {stdout} = await runNoPipe(`.name package.json`)
|
||||
t.equal(stdout, 'fx\n')
|
||||
})
|
||||
|
||||
await test('cli - very large arg', async t => {
|
||||
const {status, stderr, stdout} = await run(42, `'x => x /* dsasdfaskjdfhaskldjfhgaslkdjfhasdlkfjhasdlkfjhasdlfkjhasdflkjasdhflkjasdhflacnskdcfhalsdkfjhasldkfjhcasdlckfajhdsflbkasjdhfclnaskdjhfalskdfgjhsdflkfjhasdlfkahjsdflkasjhdflkafdggrhdfggsdfghsdghadfgsdfgsdfglhadshfglaksjdfhalskjdfhasldkfjhaldfkjhasdlfkjhasdflkjhadflkhasdlkfjhdfkhjasdlfkjhasdflkhaflkcansdfhvlkvajhfgvbalergtcqwaleifhavslbkfchasdblkfhldsfhasdfasfasdfdfdddddddadlakfjhas */'`)
|
||||
t.equal(status, 0, stderr)
|
||||
t.equal(stdout, '42\n')
|
||||
})
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user