long string test (100% coverage)
This commit is contained in:
parent
1a8f8f3626
commit
f9733b16be
@ -1,9 +1,11 @@
|
||||
var m = "foobar"; for(var i = 0; i != 11; ++i) m+=m;
|
||||
var bits = [
|
||||
[ "foobar", -1628037227, 1 ],
|
||||
[ "foo bar baz", -228401567, 1 ],
|
||||
[ "foo bar baz٪", 984445192 ],
|
||||
[ "foo bar baz٪☃", 140429620],
|
||||
[ "foo bar baz٪☃🍣", 1531648243]
|
||||
[ "foo bar baz٪☃🍣", 1531648243],
|
||||
[ m, 40270464, 1 ]
|
||||
];
|
||||
if(typeof module !== "undefined") module.exports = bits;
|
||||
/* vim: set ts=2: */
|
||||
|
@ -22,7 +22,7 @@ describe('crc32 bits', function() {
|
||||
bits.forEach(function(i) {
|
||||
var l = i[0].length;
|
||||
var msg = i[0];
|
||||
if(l > 20) i[0].substr(0,5) + "...(" + l + ")..." + i[0].substr(-5);
|
||||
if(l > 20) msg = i[0].substr(0,5) + "...(" + l + ")..." + i[0].substr(-5);
|
||||
it(msg, function() {
|
||||
if(i[2] === 1) assert.equal(X.bstr(i[0]), i[1]|0);
|
||||
assert.equal(X.str(i[0]), i[1]|0);
|
||||
|
@ -1,8 +1,10 @@
|
||||
var m = "foobar"; for(var i = 0; i != 11; ++i) m+=m;
|
||||
var bits = [
|
||||
[ "foobar", -1628037227, 1 ],
|
||||
[ "foo bar baz", -228401567, 1 ],
|
||||
[ "foo bar baz٪", 984445192 ],
|
||||
[ "foo bar baz٪☃", 140429620],
|
||||
[ "foo bar baz٪☃🍣", 1531648243]
|
||||
[ "foo bar baz٪☃🍣", 1531648243],
|
||||
[ m, 40270464, 1 ]
|
||||
];
|
||||
if(typeof module !== "undefined") module.exports = bits;
|
||||
|
2
test.js
2
test.js
@ -22,7 +22,7 @@ describe('crc32 bits', function() {
|
||||
bits.forEach(function(i) {
|
||||
var l = i[0].length;
|
||||
var msg = i[0];
|
||||
if(l > 20) i[0].substr(0,5) + "...(" + l + ")..." + i[0].substr(-5);
|
||||
if(l > 20) msg = i[0].substr(0,5) + "...(" + l + ")..." + i[0].substr(-5);
|
||||
it(msg, function() {
|
||||
if(i[2] === 1) assert.equal(X.bstr(i[0]), i[1]|0);
|
||||
assert.equal(X.str(i[0]), i[1]|0);
|
||||
|
Loading…
Reference in New Issue
Block a user