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]
---*/
verifyNotEnumerable(Intl.NumberFormat.prototype, "constructor");
verifyWritable(Intl.NumberFormat.prototype, "constructor");
verifyConfigurable(Intl.NumberFormat.prototype, "constructor");
verifyProperty(Intl.NumberFormat.prototype, "constructor", {
writable: true,
enumerable: false,
configurable: true,
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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