michael@0: // Copyright 2012 Mozilla Corporation. All rights reserved. michael@0: // This code is governed by the license found in the LICENSE file. michael@0: michael@0: /** michael@0: * @description Tests that the object returned by Intl.NumberFormat.prototype.resolvedOptions michael@0: * has the right properties. michael@0: * @author Norbert Lindenberg michael@0: */ michael@0: michael@0: $INCLUDE("testIntl.js"); michael@0: michael@0: var actual = new Intl.NumberFormat().resolvedOptions(); michael@0: michael@0: var actual2 = new Intl.NumberFormat().resolvedOptions(); michael@0: if (actual2 === actual) { michael@0: $ERROR("resolvedOptions returned the same object twice."); michael@0: } michael@0: michael@0: // this assumes the default values where the specification provides them michael@0: mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag); michael@0: mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem); michael@0: mustHaveProperty(actual, "style", ["decimal"]); michael@0: mustNotHaveProperty(actual, "currency"); michael@0: mustNotHaveProperty(actual, "currencyDisplay"); michael@0: mustHaveProperty(actual, "minimumIntegerDigits", [1]); michael@0: mustHaveProperty(actual, "minimumFractionDigits", [0]); michael@0: mustHaveProperty(actual, "maximumFractionDigits", [3]); michael@0: mustNotHaveProperty(actual, "minimumSignificantDigits"); michael@0: mustNotHaveProperty(actual, "maximumSignificantDigits"); michael@0: mustHaveProperty(actual, "useGrouping", [true]); michael@0: