tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

supportedLocalesOf-empty-and-undefined.js (902B)


      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 es5id: 9.2.1_1
      6 description: >
      7    Tests that canonicalization of locale lists treats undefined and
      8    empty lists the same.
      9 author: Norbert Lindenberg
     10 includes: [testIntl.js]
     11 ---*/
     12 
     13 testWithIntlConstructors(function (Constructor) {
     14    var supportedForUndefined = Constructor.supportedLocalesOf(undefined);
     15    var supportedForEmptyList = Constructor.supportedLocalesOf([]);
     16    assert.sameValue(supportedForUndefined.length, supportedForEmptyList.length, "Supported locales differ between undefined and empty list input.");
     17    // we don't compare the elements because length should be 0 - let's just verify that
     18    assert.sameValue(supportedForUndefined.length, 0, "Internal test error: Assumption about length being 0 is invalid.");
     19 });
     20 
     21 reportCompare(0, 0);