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

Function TestValidateRegexProgramSizeLimitToConfig

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

Source from the content-addressed store, hash-verified

250}
251
252func TestValidateRegexProgramSizeLimitToConfig(t *testing.T) {
253 val := ValidateRegexProgramSizeLimit(5)
254 cfg := val.(ConfigurableASTValidator).ToConfig()
255 if cfg.Name != regexProgramSizeLimitValidatorName {
256 t.Errorf("ToConfig().Name = %s, wanted %s", cfg.Name, regexProgramSizeLimitValidatorName)
257 }
258 if limit, ok := cfg.ConfigValue("limit"); !ok || limit != 5 {
259 t.Errorf("ToConfig().ConfigValue('limit') = %v, wanted 5", limit)
260 }
261}
262
263func TestValidateRegexProgramSizeLimitFactory(t *testing.T) {
264 val := ValidateRegexProgramSizeLimit(5)

Callers

nothing calls this directly

Calls 3

ConfigValueMethod · 0.80
ToConfigMethod · 0.65

Tested by

no test coverage detected