better printing of actual/expected buffers in error for visual compare
This commit is contained in:
parent
fd1dd95b43
commit
9a08f51a72
@ -64,18 +64,21 @@ assert.UTCDate = function(actual, year, month, day, hours, min, sec, milisecond)
|
||||
assert.equal(actualMili, milisecond, "expected milisecond " + milisecond + " but got " + actualMili);
|
||||
};
|
||||
|
||||
var spit = function(actual, expected) {
|
||||
console.log("");
|
||||
console.log("actual " + sys.inspect(actual));
|
||||
console.log("expect " + sys.inspect(expected));
|
||||
console.log("");
|
||||
}
|
||||
|
||||
assert.equalBuffers = function(actual, expected) {
|
||||
if(actual.length != expected.length) {
|
||||
console.log("");
|
||||
console.log("actual " + sys.inspect(actual));
|
||||
console.log("expect " + sys.inspect(expected));
|
||||
console.log("");
|
||||
spit(actual, expected)
|
||||
assert.equal(actual.length, expected.length);
|
||||
}
|
||||
for(var i = 0; i < actual.length; i++) {
|
||||
if(actual[i] != expected[i]) {
|
||||
console.log(actual);
|
||||
console.log(expected);
|
||||
spit(actual, expected)
|
||||
}
|
||||
assert.equal(actual[i],expected[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user