mirror of https://github.com/tc39/test262.git
Change the compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
This commit is contained in:
parent
21440c733c
commit
e72a96572b
|
@ -4,7 +4,7 @@
|
|||
/*---
|
||||
esid: sec-intl.datetimeformat.prototype.resolvedoptions
|
||||
description: Verifies the property order for the object returned by resolvedOptions().
|
||||
includes: [compareArray.js]
|
||||
includes: [arrayContains.js]
|
||||
features: [Intl.DateTimeFormat-datetimestyle]
|
||||
---*/
|
||||
|
||||
|
@ -32,4 +32,12 @@ const expected = [
|
|||
"timeStyle",
|
||||
];
|
||||
|
||||
assert.compareArray(Object.getOwnPropertyNames(options), expected);
|
||||
let actual = Object.getOwnPropertyNames(options);
|
||||
|
||||
// Ensure all expected items are in actual and also allow other properties
|
||||
// implemented in new proposals.
|
||||
assert(arrayContains(actual, expected));
|
||||
for (var i = 1; i < expected.length; i++) {
|
||||
// Ensure the order as expected but allow additional new property in between
|
||||
assert(actual.indexOf(expected[i-1]) < actual.indexOf(expected[i]));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue