mirror of https://github.com/tc39/test262.git
Intl.Segmenter: Fix copy/paste errors in tests for valid options.
This commit is contained in:
parent
c7a1edb036
commit
ba6a483c43
|
@ -3,26 +3,26 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-Intl.Segmenter
|
esid: sec-Intl.Segmenter
|
||||||
description: Checks handling of valid values for the style option to the Segmenter constructor.
|
description: Checks handling of valid values for the granularity option to the Segmenter constructor.
|
||||||
info: |
|
info: |
|
||||||
Intl.Segmenter ([ locales [ , options ]])
|
Intl.Segmenter ([ locales [ , options ]])
|
||||||
|
|
||||||
9. Let lineBreakStyle be ? GetOption(options, "lineBreakStyle", "string", « "strict", "normal", "loose" », "normal").
|
13. Let granularity be ? GetOption(options, "granularity", "string", « "grapheme", "word", "sentence", "line" », "grapheme").
|
||||||
15. If granularity is "line",
|
14. Set segmenter.[[SegmenterGranularity]] to granularity.
|
||||||
a. Set segmenter.[[SegmenterLineBreakStyle]] to r.[[lb]].
|
|
||||||
features: [Intl.Segmenter]
|
features: [Intl.Segmenter]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const validOptions = [
|
const validOptions = [
|
||||||
[undefined, "normal"],
|
[undefined, "grapheme"],
|
||||||
["strict", "strict"],
|
["grapheme", "grapheme"],
|
||||||
["normal", "normal"],
|
["word", "word"],
|
||||||
["loose", "loose"],
|
["sentence", "sentence"],
|
||||||
[{ toString() { return "loose"; } }, "loose"],
|
["line", "line"],
|
||||||
|
[{ toString() { return "line"; } }, "line"],
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const [lineBreakStyle, expected] of validOptions) {
|
for (const [granularity, expected] of validOptions) {
|
||||||
const segmenter = new Intl.Segmenter([], { granularity: "line", lineBreakStyle });
|
const segmenter = new Intl.Segmenter([], { granularity });
|
||||||
const resolvedOptions = segmenter.resolvedOptions();
|
const resolvedOptions = segmenter.resolvedOptions();
|
||||||
assert.sameValue(resolvedOptions.lineBreakStyle, expected);
|
assert.sameValue(resolvedOptions.granularity, expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-Intl.Segmenter
|
esid: sec-Intl.Segmenter
|
||||||
description: Checks handling of valid values for the style option to the Segmenter constructor.
|
description: Checks handling of valid values for the lineBreakStyle option to the Segmenter constructor.
|
||||||
info: |
|
info: |
|
||||||
Intl.Segmenter ([ locales [ , options ]])
|
Intl.Segmenter ([ locales [ , options ]])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue