Use verifyProperty in test/intl402/DateTimeFormat tests

This commit is contained in:
André Bargull 2023-09-11 15:43:25 +02:00 committed by Ms2ger
parent 967b16500a
commit fe2c17bf4b
15 changed files with 83 additions and 62 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -21,8 +21,9 @@ includes: [propertyHelper.js]
var formatFn = new Intl.DateTimeFormat().format; var formatFn = new Intl.DateTimeFormat().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.DateTimeFormat.prototype, "format"); var desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.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.DateTimeFormat.prototype, "format"); var desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.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.DateTimeFormat.prototype, "forma
assert.sameValue(desc.set, undefined); assert.sameValue(desc.set, undefined);
assert.sameValue(typeof desc.get, "function"); assert.sameValue(typeof desc.get, "function");
verifyNotEnumerable(Intl.DateTimeFormat.prototype, "format"); verifyProperty(Intl.DateTimeFormat.prototype, "format", {
verifyConfigurable(Intl.DateTimeFormat.prototype, "format"); enumerable: false,
configurable: true,
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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