Skip to content

Commit

Permalink
Fix BCP47MAtcher test
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Sep 5, 2023
1 parent 4b34c73 commit 4167a6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion i18n/locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ func TestLocale(t *testing.T) {
assert.Equal(t, i18n.NilLocale, lc)
}

func TesBCP47Matcher(t *testing.T) {
func TestBCP47Matcher(t *testing.T) {
tests := []struct {
preferred []i18n.Locale
available []string
best string
}{
{preferred: []i18n.Locale{"eng-US"}, available: []string{"es_EC", "en-US"}, best: "en-US"},
{preferred: []i18n.Locale{"spa-US", "eng-US"}, available: []string{"en-GB", "en-US", "es-US"}, best: "es-US"},
{preferred: []i18n.Locale{"eng-US"}, available: []string{"es", "en"}, best: "en"},
{preferred: []i18n.Locale{"eng"}, available: []string{"es-US", "en-UK"}, best: "en-UK"},
{preferred: []i18n.Locale{"eng", "fra"}, available: []string{"fr-CA", "en-RW"}, best: "en-RW"},
Expand Down

0 comments on commit 4167a6b

Please sign in to comment.