Skip to content
Snippets Groups Projects
Unverified Commit 92003a3e authored by Rick Waldron's avatar Rick Waldron Committed by GitHub
Browse files

Merge pull request #1576 from Ms2ger/pluralCategories

Add a test for pluralrules.resolvedOptions().pluralCategories.
parents c1c60447 cd6198b6
No related branches found
No related tags found
No related merge requests found
// Copyright 2018 Igalia S.L. All rights reserved.
// This code is governed by the license found in the LICENSE file.
/*---
esid: sec-Intl.PluralRules.prototype.resolvedOptions
description: >
Tests that Intl.PluralRules.prototype.resolvedOptions creates a new array
for the pluralCategories property on every call.
includes: [testIntl.js, propertyHelper.js, compareArray.js]
---*/
const allowedValues = ["zero", "one", "two", "few", "many", "other"];
const pluralrules = new Intl.PluralRules();
const options1 = pluralrules.resolvedOptions();
const options2 = pluralrules.resolvedOptions();
assert.notSameValue(options1.pluralCategories, options2.pluralCategories, "Should have different arrays");
assert.compareArray(options1.pluralCategories, options2.pluralCategories, "Arrays should have same values");
for (const category of options1.pluralCategories) {
assert(allowedValues.includes(category), `Found ${category}, expected one of ${allowedValues}`);
}
verifyProperty(options1, "pluralCategories", {
writable: true,
enumerable: true,
configurable: true,
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment