(t *testing.T)
| 1112 | } |
| 1113 | |
| 1114 | func TestCheck_EmbeddedInterface(t *testing.T) { |
| 1115 | t.Run("embedded interface lookup returns compile-error not panic", func(t *testing.T) { |
| 1116 | type Env struct { |
| 1117 | context.Context |
| 1118 | Country string |
| 1119 | } |
| 1120 | type Wrapper struct { |
| 1121 | Ctx Env |
| 1122 | } |
| 1123 | |
| 1124 | config := conf.New(Wrapper{ |
| 1125 | Ctx: Env{ |
| 1126 | Context: context.Background(), |
| 1127 | Country: "TR", |
| 1128 | }, |
| 1129 | }) |
| 1130 | expr.WithContext("Ctx")(config) |
| 1131 | |
| 1132 | _, err := checker.ParseCheck("Ctx.C", config) |
| 1133 | require.Error(t, err) |
| 1134 | require.Contains(t, err.Error(), "has no field C") |
| 1135 | }) |
| 1136 | } |
| 1137 | |
| 1138 | func TestCheck_types(t *testing.T) { |
| 1139 | env := types.Map{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…