MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestBadLocale

Function TestBadLocale

ext/formatting_test.go:1069–1078  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1067}
1068
1069func TestBadLocale(t *testing.T) {
1070 _, err := cel.NewEnv(Strings(StringsLocale("bad-locale"), StringsVersion(3)))
1071 if err != nil {
1072 if err.Error() != "failed to parse locale: language: subtag \"locale\" is well-formed but unknown" {
1073 t.Errorf("expected error messaged to be \"failed to parse locale: language: subtag \"locale\" is well-formed but unknown\", got %q", err)
1074 }
1075 } else {
1076 t.Error("expected NewEnv to fail during locale parsing")
1077 }
1078}
1079
1080func TestLiteralOutput(t *testing.T) {
1081 tests := []struct {

Callers

nothing calls this directly

Calls 5

NewEnvFunction · 0.92
StringsFunction · 0.85
StringsLocaleFunction · 0.85
StringsVersionFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected