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

Improved tests #2

Merged
merged 1 commit into from Aug 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions test.js
Expand Up @@ -12,8 +12,19 @@ require('chai').should();
*/

describe ('secure-compare', function () {
it ('compare', function () {
it ('should return true if the strings are identical', function () {
compare('abc', 'abc').should.equal(true);
compare('abc', 'ab').should.equal(false);
});

it ('should return true if the strings are identical in utf8', function () {
compare('你好世界', '你好世界').should.equal(true);
});

it('should return false if the strings are different lengths', function () {
compare('abc', 'ab').should.equal(false);
});

it('should return false if the strings have different contents', function () {
compare('abc', 'abd').should.equal(false);
});
});