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

Function TestValidateRegexProgramSizeLimitToConfig

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

ConfigValueMethod · 0.80
ToConfigMethod · 0.65

Tested by

no test coverage detected