Use verifyProperty in test/intl402/NumberFormat tests

This commit is contained in:
André Bargull 2023-09-11 15:43:15 +02:00 committed by Ms2ger
parent fe2c17bf4b
commit ad3f1a6ade
14 changed files with 78 additions and 61 deletions

View File

@ -24,6 +24,8 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
verifyNotEnumerable(Intl.NumberFormat.prototype, "constructor"); verifyProperty(Intl.NumberFormat.prototype, "constructor", {
verifyWritable(Intl.NumberFormat.prototype, "constructor"); writable: true,
verifyConfigurable(Intl.NumberFormat.prototype, "constructor"); enumerable: false,
configurable: true,
});

View File

@ -21,8 +21,9 @@ includes: [propertyHelper.js]
var formatFn = new Intl.NumberFormat().format; var formatFn = new Intl.NumberFormat().format;
assert.sameValue(formatFn.length, 1); verifyProperty(formatFn, "length", {
value: 1,
verifyNotEnumerable(formatFn, "length"); writable: false,
verifyNotWritable(formatFn, "length"); enumerable: false,
verifyConfigurable(formatFn, "length"); configurable: true,
});

View File

@ -26,8 +26,9 @@ includes: [propertyHelper.js]
var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format"); var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format");
assert.sameValue(desc.get.length, 0); verifyProperty(desc.get, "length", {
value: 0,
verifyNotEnumerable(desc.get, "length"); writable: false,
verifyNotWritable(desc.get, "length"); enumerable: false,
verifyConfigurable(desc.get, "length"); configurable: true,
});

View File

@ -21,8 +21,9 @@ includes: [propertyHelper.js]
var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format"); var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format");
assert.sameValue(desc.get.name, "get format"); verifyProperty(desc.get, "name", {
value: "get format",
verifyNotEnumerable(desc.get, "name"); writable: false,
verifyNotWritable(desc.get, "name"); enumerable: false,
verifyConfigurable(desc.get, "name"); configurable: true,
});

View File

@ -31,5 +31,7 @@ var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format"
assert.sameValue(desc.set, undefined); assert.sameValue(desc.set, undefined);
assert.sameValue(typeof desc.get, "function"); assert.sameValue(typeof desc.get, "function");
verifyNotEnumerable(Intl.NumberFormat.prototype, "format"); verifyProperty(Intl.NumberFormat.prototype, "format", {
verifyConfigurable(Intl.NumberFormat.prototype, "format"); enumerable: false,
configurable: true,
});

View File

@ -6,8 +6,9 @@ description: Intl.NumberFormat.prototype.formatToParts.length.
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.prototype.formatToParts.length, 1); verifyProperty(Intl.NumberFormat.prototype.formatToParts, "length", {
value: 1,
verifyNotEnumerable(Intl.NumberFormat.prototype.formatToParts, "length"); writable: false,
verifyNotWritable(Intl.NumberFormat.prototype.formatToParts, "length"); enumerable: false,
verifyConfigurable(Intl.NumberFormat.prototype.formatToParts, "length"); configurable: true,
});

View File

@ -6,10 +6,9 @@ description: Intl.NumberFormat.prototype.formatToParts.name value and descriptor
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.prototype.formatToParts.name, 'formatToParts', verifyProperty(Intl.NumberFormat.prototype.formatToParts, "name", {
'The value of `Intl.NumberFormat.prototype.formatToParts.name` is `"formatToParts"`' value: "formatToParts",
); writable: false,
enumerable: false,
verifyNotEnumerable(Intl.NumberFormat.prototype.formatToParts, 'name'); configurable: true,
verifyNotWritable(Intl.NumberFormat.prototype.formatToParts, 'name'); });
verifyConfigurable(Intl.NumberFormat.prototype.formatToParts, 'name');

View File

@ -32,6 +32,8 @@ assert.sameValue(
'`typeof Intl.NumberFormat.prototype.formatToParts` is `function`' '`typeof Intl.NumberFormat.prototype.formatToParts` is `function`'
); );
verifyNotEnumerable(Intl.NumberFormat.prototype, 'formatToParts'); verifyProperty(Intl.NumberFormat.prototype, "formatToParts", {
verifyWritable(Intl.NumberFormat.prototype, 'formatToParts'); writable: true,
verifyConfigurable(Intl.NumberFormat.prototype, 'formatToParts'); enumerable: false,
configurable: true,
});

View File

@ -24,8 +24,9 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.prototype.resolvedOptions.length, 0); verifyProperty(Intl.NumberFormat.prototype.resolvedOptions, "length", {
value: 0,
verifyNotEnumerable(Intl.NumberFormat.prototype.resolvedOptions, "length"); writable: false,
verifyNotWritable(Intl.NumberFormat.prototype.resolvedOptions, "length"); enumerable: false,
verifyConfigurable(Intl.NumberFormat.prototype.resolvedOptions, "length"); configurable: true,
});

View File

@ -19,8 +19,9 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.prototype.resolvedOptions.name, "resolvedOptions"); verifyProperty(Intl.NumberFormat.prototype.resolvedOptions, "name", {
value: "resolvedOptions",
verifyNotEnumerable(Intl.NumberFormat.prototype.resolvedOptions, "name"); writable: false,
verifyNotWritable(Intl.NumberFormat.prototype.resolvedOptions, "name"); enumerable: false,
verifyConfigurable(Intl.NumberFormat.prototype.resolvedOptions, "name"); configurable: true,
});

View File

@ -24,6 +24,8 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
verifyNotEnumerable(Intl.NumberFormat.prototype, "resolvedOptions"); verifyProperty(Intl.NumberFormat.prototype, "resolvedOptions", {
verifyWritable(Intl.NumberFormat.prototype, "resolvedOptions"); writable: true,
verifyConfigurable(Intl.NumberFormat.prototype, "resolvedOptions"); enumerable: false,
configurable: true,
});

View File

@ -24,8 +24,9 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.supportedLocalesOf.length, 1); verifyProperty(Intl.NumberFormat.supportedLocalesOf, "length", {
value: 1,
verifyNotEnumerable(Intl.NumberFormat.supportedLocalesOf, "length"); writable: false,
verifyNotWritable(Intl.NumberFormat.supportedLocalesOf, "length"); enumerable: false,
verifyConfigurable(Intl.NumberFormat.supportedLocalesOf, "length"); configurable: true,
});

View File

@ -19,8 +19,9 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.supportedLocalesOf.name, "supportedLocalesOf"); verifyProperty(Intl.NumberFormat.supportedLocalesOf, "name", {
value: "supportedLocalesOf",
verifyNotEnumerable(Intl.NumberFormat.supportedLocalesOf, "name"); writable: false,
verifyNotWritable(Intl.NumberFormat.supportedLocalesOf, "name"); enumerable: false,
verifyConfigurable(Intl.NumberFormat.supportedLocalesOf, "name"); configurable: true,
});

View File

@ -24,6 +24,8 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
verifyNotEnumerable(Intl.NumberFormat, "supportedLocalesOf"); verifyProperty(Intl.NumberFormat, "supportedLocalesOf", {
verifyWritable(Intl.NumberFormat, "supportedLocalesOf"); writable: true,
verifyConfigurable(Intl.NumberFormat, "supportedLocalesOf"); enumerable: false,
configurable: true,
});