Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Fix bug in formatting of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Jul 18, 2016
1 parent 6aa099f commit 6073887
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"license": "MIT",
"dependencies": {
"should-equal": "^1.0.0",
"should-format": "^1.0.0",
"should-format": "^2.0.0",
"should-type": "^1.0.0"
},
"files": [
Expand Down
23 changes: 22 additions & 1 deletion test/ext/eql.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('eql', function() {

it('should allow to test with prototypes', function() {
should.config.checkProtoEql = false;

var b = {a: 2};
var a = Object.create(null);
a.a = 2;
Expand Down Expand Up @@ -73,4 +73,25 @@ describe('eql', function() {
({ a: 'ab' }).should.be.oneOf('a', 10, 'ab', { a: 'ab' });
({ a: 'ab' }).should.be.oneOf(['a', 10, 'ab', { a: 'ab' }]);
});

it('should correct print arrays in error message', function() {
var toTest = [
0, 1, 0, 4,
0, 0, 0, 3,
0, 4, 5, 0,
0, 0, 0, 6,
];

var expected = [
0, 1, 0, 3,
0, 0, 0, 3,
0, 4, 5, 0,
0, 0, 0, 6,
];


err(function() {
toTest.should.eql(expected);
}, 'expected Array [ 0, 1, 0, 4, 0, 0, 0, 3, 0, 4, 5, 0, 0, 0, 0, 6 ] to equal Array [ 0, 1, 0, 3, 0, 0, 0, 3, 0, 4, 5, 0, 0, 0, 0, 6 ] (at \'3\', A has 4 and B has 3)');
});
});

0 comments on commit 6073887

Please sign in to comment.