use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class DefaultLocaleTimezone method testGMT_plus_0.
@Test
public void testGMT_plus_0() throws Exception {
Realm realm = newRealm(TimeZone.getTimeZone("GMT+0"));
assertEquals("UTC", resolvedTimeZone(realm));
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method testUnsupportedLocale.
@Test
public void testUnsupportedLocale() throws Exception {
// = i-klingon
String languageTag = "tlh";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("en", resolvedLocale(realm, constructor));
}
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method test_de_CH.
@Test
public void test_de_CH() throws Exception {
String languageTag = "de-CH";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("de-CH", resolvedLocale(realm, constructor));
}
for (Intl constructor : Intl.values()) {
assertEquals("de-CH", resolvedLocaleLookup(realm, constructor));
}
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method test_ce.
@Test
public void test_ce() throws Exception {
// 'ce' is not supported by Collator, no fallback is available, hence defaults to 'en'.
String languageTag = "ce";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("en", resolvedLocale(realm, constructor));
}
for (Intl constructor : Intl.values()) {
assertEquals("en", resolvedLocaleLookup(realm, constructor));
}
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method testLocaleWithScriptAndRegionAndVariant.
@Test
public void testLocaleWithScriptAndRegionAndVariant() throws Exception {
String languageTag = "de-Latn-AT-1996";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("de-AT", resolvedLocale(realm, constructor));
}
}
Aggregations