mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Replace mustNotHaveProperty with verifyProperty
This commit is contained in:
parent
20ea611db7
commit
ce3c3d7dbd
@ -873,19 +873,6 @@ function mustHaveProperty(obj, property, valid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests whether the given object does not have the named property.
|
|
||||||
* @param {Object} obj the object to be tested.
|
|
||||||
* @param {string} property the name of the property
|
|
||||||
* @exception if the property is present.
|
|
||||||
*/
|
|
||||||
function mustNotHaveProperty(obj, property) {
|
|
||||||
if (obj.hasOwnProperty(property)) {
|
|
||||||
$ERROR("Object has property it mustn't have: " + property + ".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties of the RegExp constructor that may be affected by use of regular
|
* Properties of the RegExp constructor that may be affected by use of regular
|
||||||
* expressions, and the default values of these properties. Properties are from
|
* expressions, and the default values of these properties. Properties are from
|
||||||
|
@ -8,7 +8,7 @@ description: >
|
|||||||
Intl.DateTimeFormat.prototype.resolvedOptions has the right
|
Intl.DateTimeFormat.prototype.resolvedOptions has the right
|
||||||
properties.
|
properties.
|
||||||
author: Norbert Lindenberg
|
author: Norbert Lindenberg
|
||||||
includes: [testIntl.js]
|
includes: [testIntl.js, propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var actual = new Intl.DateTimeFormat().resolvedOptions();
|
var actual = new Intl.DateTimeFormat().resolvedOptions();
|
||||||
@ -39,13 +39,13 @@ mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag);
|
|||||||
mustHaveProperty(actual, "calendar", calendars);
|
mustHaveProperty(actual, "calendar", calendars);
|
||||||
mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem);
|
mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem);
|
||||||
mustHaveProperty(actual, "timeZone", isCanonicalizedStructurallyValidTimeZoneName);
|
mustHaveProperty(actual, "timeZone", isCanonicalizedStructurallyValidTimeZoneName);
|
||||||
mustNotHaveProperty(actual, "weekday");
|
verifyProperty(actual, "weekday", undefined);
|
||||||
mustNotHaveProperty(actual, "era");
|
verifyProperty(actual, "era", undefined);
|
||||||
mustHaveProperty(actual, "year", ["2-digit", "numeric"]);
|
mustHaveProperty(actual, "year", ["2-digit", "numeric"]);
|
||||||
mustHaveProperty(actual, "month", ["2-digit", "numeric", "narrow", "short", "long"]);
|
mustHaveProperty(actual, "month", ["2-digit", "numeric", "narrow", "short", "long"]);
|
||||||
mustHaveProperty(actual, "day", ["2-digit", "numeric"]);
|
mustHaveProperty(actual, "day", ["2-digit", "numeric"]);
|
||||||
mustNotHaveProperty(actual, "hour");
|
verifyProperty(actual, "hour", undefined);
|
||||||
mustNotHaveProperty(actual, "minute");
|
verifyProperty(actual, "minute", undefined);
|
||||||
mustNotHaveProperty(actual, "second");
|
verifyProperty(actual, "second", undefined);
|
||||||
mustNotHaveProperty(actual, "timeZoneName");
|
verifyProperty(actual, "timeZoneName", undefined);
|
||||||
mustNotHaveProperty(actual, "hour12");
|
verifyProperty(actual, "hour12", undefined);
|
||||||
|
@ -8,7 +8,7 @@ description: >
|
|||||||
Intl.NumberFormat.prototype.resolvedOptions has the right
|
Intl.NumberFormat.prototype.resolvedOptions has the right
|
||||||
properties.
|
properties.
|
||||||
author: Norbert Lindenberg
|
author: Norbert Lindenberg
|
||||||
includes: [testIntl.js]
|
includes: [testIntl.js, propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var actual = new Intl.NumberFormat().resolvedOptions();
|
var actual = new Intl.NumberFormat().resolvedOptions();
|
||||||
@ -20,11 +20,11 @@ assert.notSameValue(actual2, actual, "resolvedOptions returned the same object t
|
|||||||
mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag);
|
mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag);
|
||||||
mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem);
|
mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem);
|
||||||
mustHaveProperty(actual, "style", ["decimal"]);
|
mustHaveProperty(actual, "style", ["decimal"]);
|
||||||
mustNotHaveProperty(actual, "currency");
|
verifyProperty(actual, "currency", undefined);
|
||||||
mustNotHaveProperty(actual, "currencyDisplay");
|
verifyProperty(actual, "currencyDisplay", undefined);
|
||||||
mustHaveProperty(actual, "minimumIntegerDigits", [1]);
|
mustHaveProperty(actual, "minimumIntegerDigits", [1]);
|
||||||
mustHaveProperty(actual, "minimumFractionDigits", [0]);
|
mustHaveProperty(actual, "minimumFractionDigits", [0]);
|
||||||
mustHaveProperty(actual, "maximumFractionDigits", [3]);
|
mustHaveProperty(actual, "maximumFractionDigits", [3]);
|
||||||
mustNotHaveProperty(actual, "minimumSignificantDigits");
|
verifyProperty(actual, "minimumSignificantDigits", undefined);
|
||||||
mustNotHaveProperty(actual, "maximumSignificantDigits");
|
verifyProperty(actual, "maximumSignificantDigits", undefined);
|
||||||
mustHaveProperty(actual, "useGrouping", [true]);
|
mustHaveProperty(actual, "useGrouping", [true]);
|
||||||
|
@ -8,7 +8,7 @@ description: >
|
|||||||
Intl.PluralRules.prototype.resolvedOptions has the right
|
Intl.PluralRules.prototype.resolvedOptions has the right
|
||||||
properties.
|
properties.
|
||||||
author: Zibi Braniecki
|
author: Zibi Braniecki
|
||||||
includes: [testIntl.js]
|
includes: [testIntl.js, propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var actual = new Intl.PluralRules().resolvedOptions();
|
var actual = new Intl.PluralRules().resolvedOptions();
|
||||||
@ -19,10 +19,10 @@ assert.notSameValue(actual2, actual, "resolvedOptions returned the same object t
|
|||||||
// this assumes the default values where the specification provides them
|
// this assumes the default values where the specification provides them
|
||||||
mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag);
|
mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag);
|
||||||
mustHaveProperty(actual, "type", ["cardinal"]);
|
mustHaveProperty(actual, "type", ["cardinal"]);
|
||||||
mustNotHaveProperty(actual, "currency");
|
verifyProperty(actual, "currency", undefined);
|
||||||
mustNotHaveProperty(actual, "currencyDisplay");
|
verifyProperty(actual, "currencyDisplay", undefined);
|
||||||
mustHaveProperty(actual, "minimumIntegerDigits", [1]);
|
mustHaveProperty(actual, "minimumIntegerDigits", [1]);
|
||||||
mustHaveProperty(actual, "minimumFractionDigits", [0]);
|
mustHaveProperty(actual, "minimumFractionDigits", [0]);
|
||||||
mustHaveProperty(actual, "maximumFractionDigits", [3]);
|
mustHaveProperty(actual, "maximumFractionDigits", [3]);
|
||||||
mustNotHaveProperty(actual, "minimumSignificantDigits");
|
verifyProperty(actual, "minimumSignificantDigits", undefined);
|
||||||
mustNotHaveProperty(actual, "maximumSignificantDigits");
|
verifyProperty(actual, "maximumSignificantDigits", undefined);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user