diff --git a/test/intl402/DurationFormat/prototype/format/length.js b/test/intl402/DurationFormat/prototype/format/length.js new file mode 100644 index 0000000000..94bfeb3499 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/format/length.js @@ -0,0 +1,35 @@ +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.datetimeformat.prototype.format +description: > + Intl.DateTimeFormat.prototype.format.length is 1. +info: | + Intl.DurationFormat.prototype.format ( duration ) + + 17 ECMAScript Standard Built-in Objects: + + Every built-in function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description. Optional parameters + (which are indicated with brackets: [ ]) or rest parameters (which + are shown using the form «...name») are not included in the default + argument count. + Unless otherwise specified, the length property of a built-in function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. + +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Intl.DateTimeFormat.prototype.format.length, 1); + +verifyProperty(Intl.DurationFormat.prototype.format, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); + diff --git a/test/intl402/DurationFormat/prototype/formatToParts/length.js b/test/intl402/DurationFormat/prototype/formatToParts/length.js new file mode 100644 index 0000000000..edc21dab52 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/formatToParts/length.js @@ -0,0 +1,35 @@ +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.datetimeformat.prototype.formatToParts +description: > + Intl.DateTimeFormat.prototype.formatToParts.length is 1. +info: | + Intl.DateTimeFormat.prototype.formatToParts ( date ) + + 17 ECMAScript Standard Built-in Objects: + + Every built-in function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description. Optional parameters + (which are indicated with brackets: [ ]) or rest parameters (which + are shown using the form «...name») are not included in the default + argument count. + Unless otherwise specified, the length property of a built-in function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. + +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Intl.DateTimeFormat.prototype.formatToParts.length, 1); + +verifyProperty(Intl.DurationFormat.prototype.formatToParts, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); + diff --git a/test/intl402/DurationFormat/prototype/formatToParts/name.js b/test/intl402/DurationFormat/prototype/formatToParts/name.js new file mode 100644 index 0000000000..934d9cbe97 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/formatToParts/name.js @@ -0,0 +1,26 @@ +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.formatToParts +description: Checks the "name" property of Intl.DurationFormat.prototype.formatToParts(). +info: | + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. + +includes: [propertyHelper.js] +features: [Intl.DurationFormat] +---*/ + +verifyProperty(Intl.DurationFormat.prototype.formatToParts, "name", { + value: "formatToParts", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/DurationFormat/prototype/formatToParts/prop-desc.js b/test/intl402/DurationFormat/prototype/formatToParts/prop-desc.js new file mode 100644 index 0000000000..b00ca30f86 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/formatToParts/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.formatToParts +description: Property descriptor of Intl.DurationFormat.prototype.formatToParts +includes: [propertyHelper.js] +features: [Intl.DurationFormat] +---*/ + +assert.sameValue( + typeof Intl.DurationFormat.prototype.formatToParts, + 'function', + '`typeof Intl.DurationFormat.prototype.formatToParts` is `function`' +); + +verifyProperty(Intl.DurationFormat.prototype, 'formatToParts', { + enumerable: false, + writable: true, + configurable: true, +}); diff --git a/test/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js b/test/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js new file mode 100644 index 0000000000..66af26956c --- /dev/null +++ b/test/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js @@ -0,0 +1,21 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.DurationFormat.prototype.format +description: basic tests internal slot initialization and call receiver errors +info: | + Intl.DurationFormat.prototype.formatToParts ( duration ) + (...) + 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]). +features: [Intl.DurationFormat] +---*/ + +const df = new Intl.DurationFormat(); + +// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]). +let f = df['formatToParts']; + +assert.sameValue(typeof f, 'function'); +assert.throws(TypeError, () => { f('PT12.3456S') }); + diff --git a/test/intl402/DurationFormat/prototype/resolvedOptions/length.js b/test/intl402/DurationFormat/prototype/resolvedOptions/length.js new file mode 100644 index 0000000000..dfae25b004 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/resolvedOptions/length.js @@ -0,0 +1,35 @@ +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.DurationFormat.prototype.resolvedoptions +description: > + Intl.DurationFormat.prototype.resolvedOptions.length is 0. +info: | + Intl.DurationFormat.prototype.resolvedOptions () + + 17 ECMAScript Standard Built-in Objects: + + Every built-in function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description. Optional parameters + (which are indicated with brackets: [ ]) or rest parameters (which + are shown using the form «...name») are not included in the default + argument count. + Unless otherwise specified, the length property of a built-in function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. + +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Intl.DurationFormat.prototype.resolvedOptions.length, 0); + +verifyProperty(Intl.DurationFormat.prototype.resolvedOptions, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); + diff --git a/test/intl402/DurationFormat/prototype/resolvedOptions/name.js b/test/intl402/DurationFormat/prototype/resolvedOptions/name.js new file mode 100644 index 0000000000..2c486cd924 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/resolvedOptions/name.js @@ -0,0 +1,26 @@ +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.resolvedOptions +description: Checks the "name" property of Intl.DurationFormat.prototype.resolvedOptions(). +info: | + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. + +includes: [propertyHelper.js] +features: [Intl.DurationFormat] +---*/ + +verifyProperty(Intl.DurationFormat.prototype.resolvedOptions, "name", { + value: "resolvedOptions", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js b/test/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js new file mode 100644 index 0000000000..58d1bd5529 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/resolvedOptions/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.resolvedOptions +description: Property descriptor of Intl.DurationFormat.prototype.resolvedOptions +includes: [propertyHelper.js] +features: [Intl.DurationFormat] +---*/ + +assert.sameValue( + typeof Intl.DurationFormat.prototype.resolvedOptions, + 'function', + '`typeof Intl.DurationFormat.prototype.resolvedOptions` is `function`' +); + +verifyProperty(Intl.DurationFormat.prototype, 'resolvedOptions', { + enumerable: false, + writable: true, + configurable: true, +}); diff --git a/test/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js b/test/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js new file mode 100644 index 0000000000..09a1e0fe6e --- /dev/null +++ b/test/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js @@ -0,0 +1,21 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.DurationFormat.prototype.resolvedOptions +description: basic tests internal slot initialization and call receiver errors +info: | + Intl.DurationFormat.prototype.resolvedOptions ( ) + (...) + 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]). +features: [Intl.DurationFormat] +---*/ + +const df = new Intl.DurationFormat(); + +// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]). +let f = df['resolvedOptions']; + +assert.sameValue(typeof f, 'function'); +assert.throws(TypeError, () => { f() }); + diff --git a/test/intl402/DurationFormat/prototype/toStringTag/toString.js b/test/intl402/DurationFormat/prototype/toStringTag/toString.js new file mode 100644 index 0000000000..434f875935 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/toStringTag/toString.js @@ -0,0 +1,17 @@ +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.DurationFormat.prototype-@@tostringtag +description: > + Object.prototype.toString utilizes Intl.DurationFormat.prototype[@@toStringTag]. +info: | + Intl.DurationFormat.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the string value "Intl.DurationFormat". + +features: [Intl.DurationFormat, Symbol.toStringTag] +---*/ + +assert.sameValue(Object.prototype.toString.call(Intl.DurationFormat.prototype), "[object Intl.DurationFormat]"); +assert.sameValue(Object.prototype.toString.call(new Intl.DurationFormat()), "[object Intl.DurationFormat]"); diff --git a/test/intl402/DurationFormat/prototype/toStringTag.js b/test/intl402/DurationFormat/prototype/toStringTag/toStringTag.js similarity index 70% rename from test/intl402/DurationFormat/prototype/toStringTag.js rename to test/intl402/DurationFormat/prototype/toStringTag/toStringTag.js index 13544875ae..5523c92225 100644 --- a/test/intl402/DurationFormat/prototype/toStringTag.js +++ b/test/intl402/DurationFormat/prototype/toStringTag/toStringTag.js @@ -1,12 +1,18 @@ // Copyright (C) 2021 Nikhil Singhal. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +// Copyright 2022 Igalia, S.L. All rights reserved. /*--- -esid: sec-Intl.DurationFormat.prototype-@@tostringtag -description: Checks prototype's toStringTag value +esid: sec-intl.DurationFormat.prototype-@@tostringtag +description: > + Property descriptor of Intl.DurationFormat.prototype[@@toStringTag]. info: | + Intl.DurationFormat.prototype [ @@toStringTag ] + The initial value of the @@toStringTag property is the string value "Intl.DurationFormat". + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. + features: [Intl.DurationFormat, Symbol.toStringTag] includes: [propertyHelper.js] ---*/