|
1 // Copyright 2012 Mozilla Corporation. All rights reserved. |
|
2 // This code is governed by the BSD license found in the LICENSE file. |
|
3 |
|
4 /** |
|
5 * @description Tests that canonicalization of locale lists treats undefined and empty lists the same. |
|
6 * @author Norbert Lindenberg |
|
7 */ |
|
8 |
|
9 $INCLUDE("testIntl.js"); |
|
10 |
|
11 testWithIntlConstructors(function (Constructor) { |
|
12 var supportedForUndefined = Constructor.supportedLocalesOf(undefined); |
|
13 var supportedForEmptyList = Constructor.supportedLocalesOf([]); |
|
14 if (supportedForUndefined.length !== supportedForEmptyList.length) { |
|
15 $ERROR("Supported locales differ between undefined and empty list input."); |
|
16 } |
|
17 // we don't compare the elements because length should be 0 - let's just verify that |
|
18 if (supportedForUndefined.length !== 0) { |
|
19 $ERROR("Internal test error: Assumption about length being 0 is invalid."); |
|
20 } |
|
21 return true; |
|
22 }); |
|
23 |