Skip to content
Prev Previous commit
Next Next commit
test must localize
  • Loading branch information
nicksnyder committed Sep 28, 2020
commit b7176e8a9cfd6f3616a5226894a5ebbc74007664
13 changes: 13 additions & 0 deletions v2/i18n/localizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,16 @@ func TestMessageIDMismatchError(t *testing.T) {
t.Fatalf("expected %q; got %q", expected, actual)
}
}

func TestMustLocalize(t *testing.T) {
defer func() {
if recover() == nil {
t.Fatalf("MustLocalize did not panic")
}
}()
bundle := NewBundle(language.English)
localizer := NewLocalizer(bundle)
localizer.MustLocalize(&LocalizeConfig{
MessageID: "hello",
})
}