aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/text/language/display/display_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/text/language/display/display_test.go')
-rw-r--r--vendor/golang.org/x/text/language/display/display_test.go33
1 files changed, 21 insertions, 12 deletions
diff --git a/vendor/golang.org/x/text/language/display/display_test.go b/vendor/golang.org/x/text/language/display/display_test.go
index 35f0878..4f5b48e 100644
--- a/vendor/golang.org/x/text/language/display/display_test.go
+++ b/vendor/golang.org/x/text/language/display/display_test.go
@@ -371,9 +371,6 @@ func TestTag(t *testing.T) {
{"sr-Latn", "sr-Latn-ME", "srpskohrvatski (Crna Gora)"},
// Double script and region
{"nl", "en-Cyrl-BE", "Engels (Cyrillisch, België)"},
- // Canonical equivalents.
- {"ro", "ro-MD", "moldovenească"},
- {"ro", "mo", "moldovenească"},
}
for _, tt := range tests {
t.Run(tt.dict+"/"+tt.tag, func(t *testing.T) {
@@ -445,9 +442,6 @@ func TestLanguage(t *testing.T) {
{"en", "af-NA", "Afrikaans"},
{"en", "zu-BR", "Zulu"},
{"agq", "zh-Hant", "|[language: zh-Hant]"},
- // Canonical equivalents.
- {"ro", "ro-MD", "moldovenească"},
- {"ro", "mo", "moldovenească"},
{"en", "sh", "Serbo-Croatian"},
{"en", "sr-Latn", "Serbo-Croatian"},
{"en", "sr", "Serbian"},
@@ -540,8 +534,6 @@ func TestRegion(t *testing.T) {
{"nl", "NL", "Nederland"},
{"en", "US", "United States"},
{"en", "ZZ", "Unknown Region"},
- {"en", "UM", "U.S. Outlying Islands"},
- {"en-GB", "UM", "U.S. Outlying Islands"},
{"en-GB", "NL", "Netherlands"},
// Canonical equivalents
{"en", "UK", "United Kingdom"},
@@ -628,9 +620,6 @@ func TestSelf(t *testing.T) {
{"sr-Latn-ME", "srpskohrvatski"},
{"sr-Cyrl-ME", "српски"},
{"sr-NL", "српски"},
- // Canonical equivalents.
- {"ro-MD", "moldovenească"},
- {"mo", "moldovenească"},
// NOTE: kk is defined, but in Cyrillic script. For China, Arab is the
// dominant script. We do not have data for kk-Arab and we chose to not
// fall back in such cases.
@@ -644,6 +633,27 @@ func TestSelf(t *testing.T) {
}
}
+func TestEquivalence(t *testing.T) {
+ testCases := []struct {
+ desc string
+ namer Namer
+ }{
+ {"Self", Self},
+ {"Tags", Tags(language.Romanian)},
+ {"Languages", Languages(language.Romanian)},
+ {"Scripts", Scripts(language.Romanian)},
+ }
+ for _, tc := range testCases {
+ t.Run(tc.desc, func(t *testing.T) {
+ ro := tc.namer.Name(language.Raw.MustParse("ro-MD"))
+ mo := tc.namer.Name(language.Raw.MustParse("mo"))
+ if ro != mo {
+ t.Errorf("%q != %q", ro, mo)
+ }
+ })
+ }
+}
+
func TestDictionaryLang(t *testing.T) {
tests := []struct {
d *Dictionary
@@ -693,7 +703,6 @@ func TestDictionaryScript(t *testing.T) {
name string
}{
{English, "Cyrl", "Cyrillic"},
- {Portuguese, "Gujr", "gujerati"},
{EuropeanPortuguese, "Gujr", "guzerate"},
}
for i, test := range tests {