Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nina 2016 code-n-learn, issue: use assert.Equal() #9977

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions test/parallel/test-fs-append-file-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fs.appendFileSync(filename, data);

var fileData = fs.readFileSync(filename);

assert.equal(Buffer.byteLength(data), fileData.length);
assert.strictEqual(Buffer.byteLength(data), fileData.length);

// test that appends data to a non empty file
var filename2 = join(common.tmpDir, 'append-sync2.txt');
Expand All @@ -34,8 +34,8 @@ fs.appendFileSync(filename2, data);

var fileData2 = fs.readFileSync(filename2);

assert.equal(Buffer.byteLength(data) + currentFileData.length,
fileData2.length);
assert.strictEqual(Buffer.byteLength(data) + currentFileData.length,
fileData2.length);

// test that appendFileSync accepts buffers
var filename3 = join(common.tmpDir, 'append-sync3.txt');
Expand All @@ -46,7 +46,7 @@ fs.appendFileSync(filename3, buf);

var fileData3 = fs.readFileSync(filename3);

assert.equal(buf.length + currentFileData.length, fileData3.length);
assert.strictEqual(buf.length + currentFileData.length, fileData3.length);

// test that appendFile accepts numbers.
var filename4 = join(common.tmpDir, 'append-sync4.txt');
Expand All @@ -58,13 +58,13 @@ fs.appendFileSync(filename4, num, { mode: m });
// windows permissions aren't unix
if (!common.isWindows) {
var st = fs.statSync(filename4);
assert.equal(st.mode & 0o700, m);
assert.strictEqual(st.mode & 0o700, m);
}

var fileData4 = fs.readFileSync(filename4);

assert.equal(Buffer.byteLength('' + num) + currentFileData.length,
fileData4.length);
assert.strictEqual(Buffer.byteLength('' + num) + currentFileData.length,
fileData4.length);

// test that appendFile accepts file descriptors
var filename5 = join(common.tmpDir, 'append-sync5.txt');
Expand All @@ -76,8 +76,8 @@ fs.closeSync(filename5fd);

var fileData5 = fs.readFileSync(filename5);

assert.equal(Buffer.byteLength(data) + currentFileData.length,
fileData5.length);
assert.strictEqual(Buffer.byteLength(data) + currentFileData.length,
fileData5.length);

//exit logic for cleanup

Expand Down