(t *testing.T)
| 440 | } |
| 441 | |
| 442 | func TestExpressionNestingDepthLimitConfigRoundTrip(t *testing.T) { |
| 443 | env, err := NewEnv(ExpressionNestingDepthLimit(128)) |
| 444 | if err != nil { |
| 445 | t.Fatalf("NewEnv(ExpressionNestingDepthLimit(128)) failed: %v", err) |
| 446 | } |
| 447 | conf, err := env.ToConfig("depth-limit") |
| 448 | if err != nil { |
| 449 | t.Fatalf("env.ToConfig() failed: %v", err) |
| 450 | } |
| 451 | found := false |
| 452 | for _, limit := range conf.Limits { |
| 453 | if limit.Name == "cel.limit.max_ast_depth" { |
| 454 | found = true |
| 455 | if limit.Value != 128 { |
| 456 | t.Errorf("limit %q value = %d, wanted 128", limit.Name, limit.Value) |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | if !found { |
| 461 | t.Errorf("env config limits %v missing 'cel.limit.max_ast_depth'", conf.Limits) |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | func TestRefValueToValue_Error(t *testing.T) { |
| 466 | _, err := RefValueToValue(types.NewErr("test error")) |
nothing calls this directly
no test coverage detected