Debian Codegraph @

js/src/tests/non262/Intl/PluralRules/pluralrules.js

raw
1 // |reftest| skip-if(!this.hasOwnProperty("Intl"))
2
3 // Tests the format function with a diverse set of locales and options.
4
5 var pr;
6
7 pr = new Intl.PluralRules("en-us");
8 assertEq(pr.resolvedOptions().locale, "en-US");
9 assertEq(pr.resolvedOptions().type, "cardinal");
10 assertEq(pr.resolvedOptions().pluralCategories.length, 2);
11
12 pr = new Intl.PluralRules("de", {type: 'cardinal'});
13 assertEq(pr.resolvedOptions().pluralCategories.length, 2);
14
15 pr = new Intl.PluralRules("de", {type: 'ordinal'});
16 assertEq(pr.resolvedOptions().pluralCategories.length, 1);
17
18 reportCompare(0, 0, 'ok');