Array equality treats undefined elements as equal however they got in there

- Fixes #786
This commit is contained in:
Gregg Van Hove
2016-02-22 11:06:59 -08:00
parent 602f5bc08a
commit 5458f2f18d
3 changed files with 95 additions and 48 deletions
+7
View File
@@ -54,6 +54,13 @@ describe("matchersUtil", function() {
expect(jasmineUnderTest.matchersUtil.equals([1, 2], [1, 2])).toBe(true);
});
it("passes for Arrays that are equivalent, with elements added by changing length", function() {
var foo = [];
foo.length = 1;
expect(jasmineUnderTest.matchersUtil.equals(foo, [undefined])).toBe(true);
});
it("fails for Arrays that are not equivalent", function() {
expect(jasmineUnderTest.matchersUtil.equals([1, 2], [1, 2, 3])).toBe(false);
});