node.js - assert.deepEqual does not seem to work correctly -
i want test serialize function of nodejs module i've written.
in tests have following strange behavior:
assert.equal(json.stringify(obj1), json.stringify(obj2)); // => test ok assert.deepequal(obj1, obj2); // => test fails
i have no clue going wrong here. objects seem identical in opinion.
obj1:
{ "config": { "index_amount": 12, "ignore_case": true, "debug": false }, "indexes": [{ "p": [0, 1], "e": [0], "t": [0], "r": [0, 2], "a": [1, 2], "u": [1], "l": [1], "m": [2], "i": [2] }, { "pe": [0], "et": [0], "te": [0], "er": [0], "pa": [1], "au": [1], "ul": [1], "ma": [2], "ar": [2], "ri": [2], "ia": [2] }, { "pet": [0], "ete": [0], "ter": [0], "pau": [1], "aul": [1], "mar": [2], "ari": [2], "ria": [2] }, { "pete": [0], "eter": [0], "paul": [1], "mari": [2], "aria": [2] }, { "peter": [0], "maria": [2] }, {}, {}, {}, {}, {}, {}, {}], "data": ["peter", "paul", "maria"], "data_ptr": 3, "free_slots": [], "single_data_counter": 3 }
obj2:
{ "config": { "index_amount": 12, "ignore_case": true, "debug": false }, "indexes": [{ "p": [0, 1], "e": [0], "t": [0], "r": [0, 2], "a": [1, 2], "u": [1], "l": [1], "m": [2], "i": [2] }, { "pe": [0], "et": [0], "te": [0], "er": [0], "pa": [1], "au": [1], "ul": [1], "ma": [2], "ar": [2], "ri": [2], "ia": [2] }, { "pet": [0], "ete": [0], "ter": [0], "pau": [1], "aul": [1], "mar": [2], "ari": [2], "ria": [2] }, { "pete": [0], "eter": [0], "paul": [1], "mari": [2], "aria": [2] }, { "peter": [0], "maria": [2] }, {}, {}, {}, {}, {}, {}, {}], "data": ["peter", "paul", "maria"], "data_ptr": 3, "free_slots": [], "single_data_counter": 3 }
Comments
Post a Comment