mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
fix test
1. "–" => " – " 2. Move the verifyProperty after assert.sameValue because it has side effect of removing that property while it is writable.
This commit is contained in:
parent
b91167622b
commit
16f3f494d3
@ -19,6 +19,10 @@ function* zip(a, b) {
|
|||||||
|
|
||||||
function compare(actual, expected) {
|
function compare(actual, expected) {
|
||||||
for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
|
for (const [i, actualEntry, expectedEntry] of zip(actual, expected)) {
|
||||||
|
// assertions
|
||||||
|
assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
|
||||||
|
assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
|
||||||
|
assert.sameValue(actualEntry.source, expectedEntry.source, `source for entry ${i}`);
|
||||||
|
|
||||||
// 1.1.25_4.a Let O be ObjectCreate(%ObjectPrototype%).
|
// 1.1.25_4.a Let O be ObjectCreate(%ObjectPrototype%).
|
||||||
assert.sameValue(Object.getPrototypeOf(actualEntry), Object.prototype, `prototype for entry ${i}`);
|
assert.sameValue(Object.getPrototypeOf(actualEntry), Object.prototype, `prototype for entry ${i}`);
|
||||||
@ -28,11 +32,6 @@ function compare(actual, expected) {
|
|||||||
verifyProperty(actualEntry, 'value', { enumerable: true, writable: true, configurable: true });
|
verifyProperty(actualEntry, 'value', { enumerable: true, writable: true, configurable: true });
|
||||||
// 1.1.25_4.d Perform ! CreateDataPropertyOrThrow(O, "source", part.[[Source]]).
|
// 1.1.25_4.d Perform ! CreateDataPropertyOrThrow(O, "source", part.[[Source]]).
|
||||||
verifyProperty(actualEntry, 'source', { enumerable: true, writable: true, configurable: true });
|
verifyProperty(actualEntry, 'source', { enumerable: true, writable: true, configurable: true });
|
||||||
|
|
||||||
// assertions
|
|
||||||
assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`);
|
|
||||||
assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`);
|
|
||||||
assert.sameValue(actualEntry.source, expectedEntry.source, `source for entry ${i}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ const nf = new Intl.NumberFormat("en-US", {
|
|||||||
compare(nf.formatRangeToParts(3, 5), [
|
compare(nf.formatRangeToParts(3, 5), [
|
||||||
{type: "currency", value: "$", source: "startRange"},
|
{type: "currency", value: "$", source: "startRange"},
|
||||||
{type: "integer", value: "3", source: "startRange"},
|
{type: "integer", value: "3", source: "startRange"},
|
||||||
{type: "literal", value: "–", source: "shared"},
|
{type: "literal", value: " – ", source: "shared"},
|
||||||
{type: "currency", value: "$", source: "endRange"},
|
{type: "currency", value: "$", source: "endRange"},
|
||||||
{type: "integer", value: "5", source: "endRange"}
|
{type: "integer", value: "5", source: "endRange"}
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user