3 module.exports = function (t, a) {
6 a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
7 a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false,
8 "Different property value");
9 a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false,
10 "Property only in source");
11 a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false,
12 "Property only in target");
14 a(t("raz", "dwa"), false, "String: diff");
15 a(t("raz", "raz"), true, "String: same");
16 a(t("32", 32), false, "String & Number");
18 a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same");
19 a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff");
20 a(t(['foo'], ['one']), false, "Array: One value comparision");
22 x = { foo: { bar: { mar: {} } } };
23 y = { foo: { bar: { mar: {} } } };
24 a(t(x, y), true, "Deep");
26 a(t({ foo: { bar: { mar: 'foo' } } }, { foo: { bar: { mar: {} } } }),
27 false, "Deep: false");
29 x = { foo: { bar: { mar: {} } } };
32 y = { foo: { bar: { mar: {} } } };
35 a(t(x, y), true, "Object: Infinite Recursion: Same #1");
38 a(t(x, y), true, "Object: Infinite Recursion: Same #2");
42 a(t(x, y), true, "Object: Infinite Recursion: Same #3");
44 y.foo.bar.mar = 'raz';
45 a(t(x, y), false, "Object: Infinite Recursion: Diff");