diff options
author | Nebojsa Ciric <cira@google.com> | 2012-04-16 13:23:13 -0700 |
---|---|---|
committer | Nebojsa Ciric <cira@google.com> | 2012-04-16 13:23:13 -0700 |
commit | 96c257264b4d2ad8e4ee94b91dee29d83ccb2f06 (patch) | |
tree | 9e19edead8add279f0ccbdf0678ade0e8c80fca8 /test/suite/intl402/ch12/12.2/12.2.2.js | |
parent | 538dd397e5e2afbfff412b4354d65991673c6fb6 (diff) | |
download | test262-96c257264b4d2ad8e4ee94b91dee29d83ccb2f06.tar.gz |
Initial intl402 checkin.
Diffstat (limited to 'test/suite/intl402/ch12/12.2/12.2.2.js')
-rw-r--r-- | test/suite/intl402/ch12/12.2/12.2.2.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/suite/intl402/ch12/12.2/12.2.2.js b/test/suite/intl402/ch12/12.2/12.2.2.js new file mode 100644 index 000000000..d16ecdceb --- /dev/null +++ b/test/suite/intl402/ch12/12.2/12.2.2.js @@ -0,0 +1,35 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @path intl402/ch12/12.2/12.2.2.js + * @description Tests that the Intl.NumberFormat has a supportedLocalesOf + * property, and it works as planned. + * @author: Roozbeh Pournader + */ + +var testcase = function() { + "use strict"; + + var supported = (new Intl.LocaleList())[0]; + var notSupported = 'zxx'; + var requestedLocales = [supported, notSupported]; + + var supportedLocales; + + if (!Intl.NumberFormat.hasOwnProperty('supportedLocalesOf')) { + $ERROR("Intl.NumberFormat doesn't have a supportedLocalesOf property."); + } + + supportedLocales = Intl.NumberFormat.supportedLocalesOf(requestedLocales); + if (supportedLocales.length !== 1) { + $ERROR('The length of supported locales list is not 1.'); + } + + if (supportedLocales[0] !== supported) { + $ERROR('The supported locale is not returned in the supported list.'); + } + + return true; +} +runTestCase(testcase); |