8000 language/display: change tests to prepare for CLDR 32 · golang/text@681d1c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 681d1c0

Browse files
committed
language/display: change tests to prepare for CLDR 32
Change-Id: I89e9b78227ff4db60efca2308d06fb1750844d64 Reviewed-on: https://go-review.googlesource.com/82904 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org>
1 parent 1516014 commit 681d1c0

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

language/display/display_test.go

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,6 @@ func TestTag(t *testing.T) {
371371
{"sr-Latn", "sr-Latn-ME", "srpskohrvatski (Crna Gora)"},
372372
// Double script and region
373373
{"nl", "en-Cyrl-BE", "Engels (Cyrillisch, België)"},
374-
// Canonical equivalents.
375-
{"ro", "ro-MD", "moldovenească"},
376-
{"ro", "mo", "moldovenească"},
377374
}
378375
for _, tt := range tests {
379376
t.Run(tt.dict+"/"+tt.tag, func(t *testing.T) {
@@ -445,9 +442,6 @@ func TestLanguage(t *testing.T) {
445442
{"en", "af-NA", "Afrikaans"},
446443
{"en", "zu-BR", "Zulu"},
447444
{"agq", "zh-Hant", "|[language: zh-Hant]"},
448-
// Canonical equivalents.
449-
{"ro", "ro-MD", "moldovenească"},
450-
{"ro", "mo", "moldovenească"},
451445
{"en", "sh", "Serbo-Croatian"},
452446
{"en", "sr-Latn", "Serbo-Croatian"},
453447
{"en", "sr", "Serbian"},
@@ -540,8 +534,6 @@ func TestRegion(t *testing.T) {
540534
{"nl", "NL", "Nederland"},
541535
{"en", "US", "United States"},
542536
{"en", "ZZ", "Unknown Region"},
543-
{"en", "UM", "U.S. Outlying Islands"},
544-
{"en-GB", "UM", "U.S. Outlying Islands"},
545537
{"en-GB", "NL", "Netherlands"},
546538
// Canonical equivalents
547539
{"en", "UK", "United Kingdom"},
@@ -628,9 +620,6 @@ func TestSelf(t *testing.T) {
628620
{"sr-Latn-ME", "srpskohrvatski"},
629621
{"sr-Cyrl-ME", "српски"},
630622
{"sr-NL", "српски"},
631-
// Canonical equivalents.
632-
{"ro-MD", "moldovenească"},
633-
{"mo", "moldovenească"},
634623
// NOTE: kk is defined, but in Cyrillic script. For China, Arab is the
635624
// dominant script. We do not have data for kk-Arab and we chose to not
636625
// fall back in such cases.
@@ -644,6 +633,27 @@ func TestSelf(t *testing.T) {
644633
}
645634
}
646635

636+
func TestEquivalence(t *testing.T) {
637+
testCases := []struct {
638+
desc string
639+
namer Namer
640+
}{
641+
{"Self", Self},
642+
{"Tags", Tags(language.Romanian)},
643+
{"Languages", Languages(language.Romanian)},
644+
{"Scripts", Scripts(language.Romanian)},
645+
}
646+
for _, tc := range testCases {
647+
t.Run(tc.desc, func(t *testing.T) {
648+
ro := tc.namer.Name(language.Raw.MustParse("ro-MD"))
649+
mo := tc.namer.Name(language.Raw.MustParse("mo"))
650+
if ro != mo {
651+
t.Errorf("%q != %q", ro, mo)
652+
}
653+
})
654+
}
655+
}
656+
647657
func TestDictionaryLang(t *testing.T) {
648658
tests := []struct {
649659
d *Dictionary
@@ -693,7 +703,6 @@ func TestDictionaryScript(t *testing.T) {
693703
name string
694704
}{
695705
{English, "Cyrl", "Cyrillic"},
696-
{Portuguese, "Gujr", "gujerati"},
697706
{EuropeanPortuguese, "Gujr", "guzerate"},
698707
}
699708
for i, test := range tests {

0 commit comments

Comments
 (0)
0