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

Function TestValidateRegexProgramSizeLimitFactory

cel/validator_test.go:262–276  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

260}
261
262func TestValidateRegexProgramSizeLimitFactory(t *testing.T) {
263 val := ValidateRegexProgramSizeLimit(5)
264 cfg := val.(ConfigurableASTValidator).ToConfig()
265 fac, ok := astValidatorFactories[regexProgramSizeLimitValidatorName]
266 if !ok {
267 t.Fatalf("missing factory for %s", regexProgramSizeLimitValidatorName)
268 }
269 vFromCfg, err := fac(cfg)
270 if err != nil {
271 t.Fatalf("fac(cfg) failed: %v", err)
272 }
273 if vFromCfg.Name() != regexProgramSizeLimitValidatorName {
274 t.Errorf("vFromCfg.Name() = %s, wanted %s", vFromCfg.Name(), regexProgramSizeLimitValidatorName)
275 }
276}
277
278func TestValidateHomogeneousAggregateLiterals(t *testing.T) {
279 env, err := NewCustomEnv(

Callers

nothing calls this directly

Calls 3

ToConfigMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected