From 0214d0b19597200daff297757d92866fc5b7d61c Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Mon, 17 Aug 2015 10:47:16 +0900 Subject: [PATCH] Remove assert_object_equals. See See https://github.com/w3c/web-platform-tests/pull/2030 and https://critic.hoppipolla.co.uk/showcomment?chain=12186 --- examples/apisample.htm | 6 ------ testharness.js | 33 --------------------------------- 2 files changed, 39 deletions(-) diff --git a/examples/apisample.htm b/examples/apisample.htm index 504a343..a361d18 100644 --- a/examples/apisample.htm +++ b/examples/apisample.htm @@ -68,12 +68,6 @@

Sample HTML5 API Tests

} test(basicAssertArrayEquals, "basic assert_array_equals test"); - function basicAssertObjectEquals() - { - assert_object_equals([1, 2, [1, 2]], { 0: 1, 1: 2, 2: { 0: 1, 1: 2} }, "array is equal to object") - } - test(basicAssertObjectEquals, "basic assert_object_equals test"); - function basicAssertApproxEquals() { assert_approx_equals(10, 11, 1, "10 is approximately (+/- 1) 11") diff --git a/testharness.js b/testharness.js index f4c66aa..b74b4c7 100644 --- a/testharness.js +++ b/testharness.js @@ -891,39 +891,6 @@ policies and contribution forms [3]. } expose(assert_in_array, "assert_in_array"); - function assert_object_equals(actual, expected, description) - { - //This needs to be improved a great deal - function check_equal(actual, expected, stack) - { - stack.push(actual); - - var p; - for (p in actual) { - assert(expected.hasOwnProperty(p), "assert_object_equals", description, - "unexpected property ${p}", {p:p}); - - if (typeof actual[p] === "object" && actual[p] !== null) { - if (stack.indexOf(actual[p]) === -1) { - check_equal(actual[p], expected[p], stack); - } - } else { - assert(same_value(actual[p], expected[p]), "assert_object_equals", description, - "property ${p} expected ${expected} got ${actual}", - {p:p, expected:expected, actual:actual}); - } - } - for (p in expected) { - assert(actual.hasOwnProperty(p), - "assert_object_equals", description, - "expected property ${p} missing", {p:p}); - } - stack.pop(); - } - check_equal(actual, expected, []); - } - expose(assert_object_equals, "assert_object_equals"); - function assert_array_equals(actual, expected, description) { assert(actual.length === expected.length,