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

Improve Strings equal tests #3902

Merged
Merged
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
8 changes: 7 additions & 1 deletion test/utils/Strings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,16 @@ contract('Strings', function (accounts) {
expect(await this.strings.methods['equal(string,string)']('aa', 'a')).to.equal(false);
});

it('compares two different strings of different (big) lengths', async function () {
it('compares two different large strings', async function () {
const str1 = 'a'.repeat(201);
const str2 = 'a'.repeat(200) + 'b';
expect(await this.strings.methods['equal(string,string)'](str1, str2)).to.equal(false);
});

it('compares two equal large strings', async function () {
const str1 = 'a'.repeat(201);
const str2 = 'a'.repeat(201);
expect(await this.strings.methods['equal(string,string)'](str1, str2)).to.equal(true);
});
});
});