Skip to content

Commit

Permalink
Catch nested NewLocale error in NewFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
euanwm committed Nov 6, 2023
1 parent 16ced0c commit 81c1426
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,12 @@ func TestFormatter_Parse(t *testing.T) {
})
}
}

func TestEmptyLocale(t *testing.T) {
locale := currency.NewLocale("")
formatter := currency.NewFormatter(locale)
got := formatter.Locale().String()
if got != "" {
t.Errorf("got %v, want fr-FR", got)
}
}

0 comments on commit 81c1426

Please sign in to comment.