test262/test/intl402/DateTimeFormat/constructor-options-timeZoneName-invalid.js
Michael Dyck 82e0487797 "Normalize" some YAML
In each case, it's the scalar value associated with the "description" key.
Normally in test262, this is written in either:
- block notation (indicated by '>' or '|'), or
- flow notation, single-line, on the same line as the key.

In the cases addressed by this PR, the value is instead written in:
- (1x) flow notation, *multi*-line, or
- (2x) flow notation, single-line, on the line *after* the key.

These are valid YAML, but they're styles that test262 doesn't otherwise use,
so could conceivably confuse people or harnesses.

This PR changes them to block notation.
2021-07-21 16:34:04 -04:00

29 lines
917 B
JavaScript

// Copyright 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializedatetimeformat
description: >
Invalid values for the `timeZoneName` option of the DateTimeFormat constructor
features: [Intl.DateTimeFormat-extend-timezonename]
---*/
assert.throws(RangeError, function () {
new Intl.DateTimeFormat('en', { timeZoneName: '' });
}, 'empty string');
assert.throws(RangeError, function () {
new Intl.DateTimeFormat('en', { timeZoneName: 'short ' });
}, '"short "');
assert.throws(RangeError, function () {
new Intl.DateTimeFormat('en', { timeZoneName: ' long' });
}, '" long"');
assert.throws(RangeError, function () {
new Intl.DateTimeFormat('en', { timeZoneName: 'offset' });
}, '"offset"');
assert.throws(RangeError, function () {
new Intl.DateTimeFormat('en', { timeZoneName: 'generic' });
}, '"generic"');