diff --git a/ctest/fixtures.js b/ctest/fixtures.js index faffab9..efdc607 100644 --- a/ctest/fixtures.js +++ b/ctest/fixtures.js @@ -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: */ diff --git a/ctest/test.js b/ctest/test.js index d4ad85d..aa8f1e7 100644 --- a/ctest/test.js +++ b/ctest/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); diff --git a/misc/bits.js b/misc/bits.js index adec546..ad8fc48 100644 --- a/misc/bits.js +++ b/misc/bits.js @@ -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; diff --git a/test.js b/test.js index d4ad85d..aa8f1e7 100644 --- a/test.js +++ b/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);