(size, useBuffer, cb)
| 13 | tmpdir.refresh(); |
| 14 | |
| 15 | function test(size, useBuffer, cb) { |
| 16 | try { |
| 17 | fs.unlinkSync(tmpFile); |
| 18 | } catch { |
| 19 | // Continue regardless of error. |
| 20 | } |
| 21 | |
| 22 | console.log(`${size} chars to ${tmpFile}...`); |
| 23 | |
| 24 | childProcess.exec(...common.escapePOSIXShell`"${ |
| 25 | process.execPath}" "${useBuffer ? scriptBuffer : scriptString}" ${size} > "${tmpFile |
| 26 | }"`, common.mustSucceed(() => { |
| 27 | console.log('done!'); |
| 28 | |
| 29 | const stat = fs.statSync(tmpFile); |
| 30 | |
| 31 | console.log(`${tmpFile} has ${stat.size} bytes`); |
| 32 | |
| 33 | assert.strictEqual(size, stat.size); |
| 34 | fs.unlinkSync(tmpFile); |
| 35 | |
| 36 | cb(); |
| 37 | })); |
| 38 | } |
| 39 | |
| 40 | test(1024 * 1024, false, common.mustCall(function() { |
| 41 | console.log('Done printing with string'); |
no test coverage detected
searching dependent graphs…