(cb)
| 70 | |
| 71 | /* eslint-disable node-core/must-call-assert */ |
| 72 | function testTruncate(cb) { |
| 73 | fs.writeFile(filename, data, function(er) { |
| 74 | if (er) return cb(er); |
| 75 | fs.stat(filename, function(er, stat) { |
| 76 | if (er) return cb(er); |
| 77 | assert.strictEqual(stat.size, 1024 * 16); |
| 78 | |
| 79 | fs.truncate(filename, 1024, function(er) { |
| 80 | if (er) return cb(er); |
| 81 | fs.stat(filename, function(er, stat) { |
| 82 | if (er) return cb(er); |
| 83 | assert.strictEqual(stat.size, 1024); |
| 84 | |
| 85 | fs.truncate(filename, function(er) { |
| 86 | if (er) return cb(er); |
| 87 | fs.stat(filename, function(er, stat) { |
| 88 | if (er) return cb(er); |
| 89 | assert.strictEqual(stat.size, 0); |
| 90 | cb(); |
| 91 | }); |
| 92 | }); |
| 93 | }); |
| 94 | }); |
| 95 | }); |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | function testFtruncate(cb) { |
| 100 | fs.writeFile(filename, data, function(er) { |
no test coverage detected
searching dependent graphs…