Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: crypto-hmac fixed lint errors introduced by strictEquals
because in 2 cases the assert.equals for several assertions
had long arguments, those arguments were misaligned when changing
to assert.strictEquals so this commit adds the extra space
for alignment.

in both cases, the final argument with prepended whitespace
extends past the 80 char limit, so these args end up being split
onto 2 lines
  • Loading branch information
eudaimos committed Dec 1, 2016
commit 280eef3f0f9fce050033857a74c52b6703448a19
10 changes: 6 additions & 4 deletions test/parallel/test-crypto-hmac.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ for (let i = 0, l = wikipedia.length; i < l; i++) {
.update(wikipedia[i]['data'])
.digest('hex');
assert.strictEqual(wikipedia[i]['hmac'][hash],
result,
'Test HMAC-' + hash + ': Test case ' + (i + 1) + ' wikipedia');
result,
'Test HMAC-' + hash + ': Test case ' + (i + 1)
+ ' wikipedia');

@jasnell jasnell Dec 5, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may be able to avoid wrapping here by using a template literal:

`Test HMAC-${hash}: Test case ${i + 1} wikipedia`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell I updated this using template string

}
}

Expand Down Expand Up @@ -234,8 +235,9 @@ for (let i = 0, l = rfc4231.length; i < l; i++) {
strRes = strRes.substr(0, 32);
}
assert.strictEqual(rfc4231[i]['hmac'][hash],
result,
'Test HMAC-' + hash + ': Test case ' + (i + 1) + ' rfc 4231');
result,
'Test HMAC-' + hash + ': Test case ' + (i + 1)
+ ' rfc 4231');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell and this one too

assert.strictEqual(strRes, result, 'Should get same result from stream');
}
}
Expand Down