use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method testLocaleWithRegionAndUnicodeExtension.
@Test
public void testLocaleWithRegionAndUnicodeExtension() throws Exception {
String languageTag = "de-AT-u-co-phonebk";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("de-AT", resolvedLocale(realm, constructor));
}
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method testLocaleWithVariant.
@Test
public void testLocaleWithVariant() throws Exception {
String languageTag = "de-1996";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("de", resolvedLocale(realm, constructor));
}
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method test_kok.
@Test
public void test_kok() throws Exception {
// 'kok' is not supported by PluralRules, no fallback is available, hence defaults to 'en'.
String languageTag = "kok";
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 testLocaleWithScript.
@Test
public void testLocaleWithScript() throws Exception {
String languageTag = "de-Latn";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("de", resolvedLocale(realm, constructor));
}
}
use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class LocaleTest method testLocaleWithUnicodeExtension.
@Test
public void testLocaleWithUnicodeExtension() throws Exception {
String languageTag = "de-u-co-phonebk";
Realm realm = newRealm(languageTag);
assertEquals(languageTag, realm.getLocale().toLanguageTag());
for (Intl constructor : Intl.values()) {
assertEquals("de", resolvedLocale(realm, constructor));
}
}
Aggregations