| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent de8eee6 commit 736b95a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,7 @@ function test(bufferAsync, bufferSync, expected) { | |||
| 16 | 16 | expected.length, | |
| 17 | 17 | 0, | |
| 18 | 18 | common.mustCall((err, bytesRead) => { | |
| 19 | + assert.ifError(err); | ||
| 19 | 20 | assert.strictEqual(bytesRead, expected.length); | |
| 20 | 21 | assert.deepStrictEqual(bufferAsync, Buffer.from(expected)); | |
| 21 | 22 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,17 +10,17 @@ common.refreshTmpDir(); | |||
| 10 | 10 | // fs.write with all parameters provided: | |
| 11 | 11 | { | |
| 12 | 12 | const filename = path.join(common.tmpDir, 'write1.txt'); | |
| 13 | - fs.open(filename, 'w', 0o644, common.mustCall(function(err, fd) { | ||
| 13 | + fs.open(filename, 'w', 0o644, common.mustCall((err, fd) => { | ||
| 14 | 14 | assert.ifError(err); | |
| 15 | 15 | ||
| 16 | - const cb = common.mustCall(function(err, written) { | ||
| 16 | + const cb = common.mustCall((err, written) => { | ||
| 17 | 17 | assert.ifError(err); | |
| 18 | 18 | ||
| 19 | 19 | assert.strictEqual(expected.length, written); | |
| 20 | 20 | fs.closeSync(fd); | |
| 21 | 21 | ||
| 22 | 22 | var found = fs.readFileSync(filename, 'utf8'); | |
| 23 | - assert.deepStrictEqual(expected.toString(), found); | ||
| 23 | + assert.strictEqual(expected.toString(), found); | ||
| 24 | 24 | }); | |
| 25 | 25 | ||
| 26 | 26 | fs.write(fd, expected, 0, expected.length, null, cb); | |
@@ -30,17 +30,17 @@ common.refreshTmpDir(); | |||
| 30 | 30 | // fs.write with a buffer, without the length parameter: | |
| 31 | 31 | { | |
| 32 | 32 | const filename = path.join(common.tmpDir, 'write2.txt'); | |
| 33 | - fs.open(filename, 'w', 0o644, common.mustCall(function(err, fd) { | ||
| 33 | + fs.open(filename, 'w', 0o644, common.mustCall((err, fd) => { | ||
| 34 | 34 | assert.ifError(err); | |
| 35 | 35 | ||
| 36 | - const cb = common.mustCall(function(err, written) { | ||
| 36 | + const cb = common.mustCall((err, written) => { | ||
| 37 | 37 | assert.ifError(err); | |
| 38 | 38 | ||
| 39 | 39 | assert.strictEqual(2, written); | |
| 40 | 40 | fs.closeSync(fd); | |
| 41 | 41 | ||
| 42 | 42 | const found = fs.readFileSync(filename, 'utf8'); | |
| 43 | - assert.deepStrictEqual('lo', found); | ||
| 43 | + assert.strictEqual('lo', found); | ||
| 44 | 44 | }); | |
| 45 | 45 | ||
| 46 | 46 | fs.write(fd, Buffer.from('hello'), 3, cb); | |
@@ -90,17 +90,17 @@ common.refreshTmpDir(); | |||
| 90 | 90 | // fs.write with offset and length passed as undefined followed by the callback: | |
| 91 | 91 | { | |
| 92 | 92 | const filename = path.join(common.tmpDir, 'write5.txt'); | |
| 93 | - fs.open(filename, 'w', 0o644, common.mustCall(function(err, fd) { | ||
| 93 | + fs.open(filename, 'w', 0o644, common.mustCall((err, fd) => { | ||
| 94 | 94 | assert.ifError(err); | |
| 95 | 95 | ||
| 96 | - const cb = common.mustCall(function(err, written) { | ||
| 96 | + const cb = common.mustCall((err, written) => { | ||
| 97 | 97 | assert.ifError(err); | |
| 98 | 98 | ||
| 99 | 99 | assert.strictEqual(expected.length, written); | |
| 100 | 100 | fs.closeSync(fd); | |
| 101 | 101 | ||
| 102 | 102 | const found = fs.readFileSync(filename, 'utf8'); | |
| 103 | - assert.deepStrictEqual(expected.toString(), found); | ||
| 103 | + assert.strictEqual(expected.toString(), found); | ||
| 104 | 104 | }); | |
| 105 | 105 | ||
| 106 | 106 | fs.write(fd, expected, undefined, undefined, cb); | |
@@ -110,17 +110,17 @@ common.refreshTmpDir(); | |||
| 110 | 110 | // fs.write with a Uint8Array, without the offset and length parameters: | |
| 111 | 111 | { | |
| 112 | 112 | const filename = path.join(common.tmpDir, 'write6.txt'); | |
| 113 | - fs.open(filename, 'w', 0o644, common.mustCall(function(err, fd) { | ||
| 113 | + fs.open(filename, 'w', 0o644, common.mustCall((err, fd) => { | ||
| 114 | 114 | assert.ifError(err); | |
| 115 | 115 | ||
| 116 | - const cb = common.mustCall(function(err, written) { | ||
| 116 | + const cb = common.mustCall((err, written) => { | ||
| 117 | 117 | assert.ifError(err); | |
| 118 | 118 | ||
| 119 | 119 | assert.strictEqual(expected.length, written); | |
| 120 | 120 | fs.closeSync(fd); | |
| 121 | 121 | ||
| 122 | 122 | const found = fs.readFileSync(filename, 'utf8'); | |
| 123 | - assert.deepStrictEqual(expected.toString(), found); | ||
| 123 | + assert.strictEqual(expected.toString(), found); | ||
| 124 | 124 | }); | |
| 125 | 125 | ||
| 126 | 126 | fs.write(fd, Uint8Array.from(expected), cb); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments