Name: js-handler/node_modules/nodeunit/node_modules/tap/test/deep.js
| 1: | var tap = require("../") |
| 2: | , test = tap.test |
| 3: | |
| 4: | test("deepEquals shouldn't care about key order", function (t) { |
| 5: | t.deepEqual({ a : 1, b : 2 }, { b : 2, a : 1 }) |
| 6: | t.end() |
| 7: | }) |
| 8: | |
| 9: | test("deepEquals shouldn't care about key order recursively", function (t) { |
| 10: | t.deepEqual( |
| 11: | { x : { a : 1, b : 2 }, y : { c : 3, d : 4 } }, |
| 12: | { y : { d : 4, c : 3 }, x : { b : 2, a : 1 } } |
| 13: | ) |
| 14: | t.end() |
| 15: | }) |
| 16: | |
| 17: | test("deepEquals shoudn't care about key order but still might", function (t) { |
| 18: | t.deepEqual( |
| 19: | [ { foo: |
| 20: | { z: 100 |
| 21: | , y: 200 |
| 22: | , x: 300 } } |
| 23: | , "bar" |
| 24: | , 11 |
| 25: | , { baz: |
| 26: | { d : 4 |
| 27: | , a: 1 |
| 28: | , b: 2 |
| 29: | , c: 3 } } ] |
| 30: | , [ { foo : |
| 31: | { z: 100 |
| 32: | , y: 200 |
| 33: | , x: 300 } } |
| 34: | , "bar" |
| 35: | , 11 |
| 36: | , { baz: |
| 37: | { a: 1 |
| 38: | , b: 2 |
| 39: | , c: 3 |
| 40: | , d: 4 } } ] |
| 41: | ) |
| 42: | t.end() |
| 43: | }); |
