From ad3f1a6ade97c9a9bdd1a2fd2aa373a9899a1a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Mon, 11 Sep 2023 15:43:15 +0200 Subject: [PATCH] Use verifyProperty in test/intl402/NumberFormat tests --- .../NumberFormat/prototype/constructor/prop-desc.js | 8 +++++--- .../prototype/format/format-function-length.js | 11 ++++++----- .../intl402/NumberFormat/prototype/format/length.js | 11 ++++++----- test/intl402/NumberFormat/prototype/format/name.js | 11 ++++++----- .../NumberFormat/prototype/format/prop-desc.js | 6 ++++-- .../NumberFormat/prototype/formatToParts/length.js | 11 ++++++----- .../NumberFormat/prototype/formatToParts/name.js | 13 ++++++------- .../prototype/formatToParts/prop-desc.js | 8 +++++--- .../prototype/resolvedOptions/length.js | 11 ++++++----- .../NumberFormat/prototype/resolvedOptions/name.js | 11 ++++++----- .../prototype/resolvedOptions/prop-desc.js | 8 +++++--- .../NumberFormat/supportedLocalesOf/length.js | 11 ++++++----- .../intl402/NumberFormat/supportedLocalesOf/name.js | 11 ++++++----- .../NumberFormat/supportedLocalesOf/prop-desc.js | 8 +++++--- 14 files changed, 78 insertions(+), 61 deletions(-) diff --git a/test/intl402/NumberFormat/prototype/constructor/prop-desc.js b/test/intl402/NumberFormat/prototype/constructor/prop-desc.js index 90589389c0..10395af565 100644 --- a/test/intl402/NumberFormat/prototype/constructor/prop-desc.js +++ b/test/intl402/NumberFormat/prototype/constructor/prop-desc.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/format/format-function-length.js b/test/intl402/NumberFormat/prototype/format/format-function-length.js index ed990780ae..8a8f1fa38a 100644 --- a/test/intl402/NumberFormat/prototype/format/format-function-length.js +++ b/test/intl402/NumberFormat/prototype/format/format-function-length.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/format/length.js b/test/intl402/NumberFormat/prototype/format/length.js index 79ed5098b7..7509d0fd78 100644 --- a/test/intl402/NumberFormat/prototype/format/length.js +++ b/test/intl402/NumberFormat/prototype/format/length.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/format/name.js b/test/intl402/NumberFormat/prototype/format/name.js index 9ff869d51a..19b3bb6740 100644 --- a/test/intl402/NumberFormat/prototype/format/name.js +++ b/test/intl402/NumberFormat/prototype/format/name.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/format/prop-desc.js b/test/intl402/NumberFormat/prototype/format/prop-desc.js index e6210dd11f..424eddc27c 100644 --- a/test/intl402/NumberFormat/prototype/format/prop-desc.js +++ b/test/intl402/NumberFormat/prototype/format/prop-desc.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/formatToParts/length.js b/test/intl402/NumberFormat/prototype/formatToParts/length.js index 7a1a9abdd2..7413e30dae 100644 --- a/test/intl402/NumberFormat/prototype/formatToParts/length.js +++ b/test/intl402/NumberFormat/prototype/formatToParts/length.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/formatToParts/name.js b/test/intl402/NumberFormat/prototype/formatToParts/name.js index 1cff87d093..1d67b7775d 100644 --- a/test/intl402/NumberFormat/prototype/formatToParts/name.js +++ b/test/intl402/NumberFormat/prototype/formatToParts/name.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/formatToParts/prop-desc.js b/test/intl402/NumberFormat/prototype/formatToParts/prop-desc.js index 9657e86229..8b5746f309 100644 --- a/test/intl402/NumberFormat/prototype/formatToParts/prop-desc.js +++ b/test/intl402/NumberFormat/prototype/formatToParts/prop-desc.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/resolvedOptions/length.js b/test/intl402/NumberFormat/prototype/resolvedOptions/length.js index 0e59b8145e..044b44a3bf 100644 --- a/test/intl402/NumberFormat/prototype/resolvedOptions/length.js +++ b/test/intl402/NumberFormat/prototype/resolvedOptions/length.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/resolvedOptions/name.js b/test/intl402/NumberFormat/prototype/resolvedOptions/name.js index 87f0bb748f..c2550fed33 100644 --- a/test/intl402/NumberFormat/prototype/resolvedOptions/name.js +++ b/test/intl402/NumberFormat/prototype/resolvedOptions/name.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/prototype/resolvedOptions/prop-desc.js b/test/intl402/NumberFormat/prototype/resolvedOptions/prop-desc.js index 17895bf1a6..ef9c741103 100644 --- a/test/intl402/NumberFormat/prototype/resolvedOptions/prop-desc.js +++ b/test/intl402/NumberFormat/prototype/resolvedOptions/prop-desc.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/supportedLocalesOf/length.js b/test/intl402/NumberFormat/supportedLocalesOf/length.js index d4da368b0d..4d39659fb9 100644 --- a/test/intl402/NumberFormat/supportedLocalesOf/length.js +++ b/test/intl402/NumberFormat/supportedLocalesOf/length.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/supportedLocalesOf/name.js b/test/intl402/NumberFormat/supportedLocalesOf/name.js index afbb2b8c97..ca5d058c63 100644 --- a/test/intl402/NumberFormat/supportedLocalesOf/name.js +++ b/test/intl402/NumberFormat/supportedLocalesOf/name.js @@ -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, +}); diff --git a/test/intl402/NumberFormat/supportedLocalesOf/prop-desc.js b/test/intl402/NumberFormat/supportedLocalesOf/prop-desc.js index b957d207c4..4604b54c9b 100644 --- a/test/intl402/NumberFormat/supportedLocalesOf/prop-desc.js +++ b/test/intl402/NumberFormat/supportedLocalesOf/prop-desc.js @@ -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, +});