(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func TestIsIntrospectionPreservesClassification(t *testing.T) { |
| 261 | cache, err := dagql.NewCache(t.Context(), "", nil, nil) |
| 262 | require.NoError(t, err) |
| 263 | ctx := dagql.ContextWithCache(t.Context(), cache) |
| 264 | |
| 265 | functionFrame := testResultCall("function", dagql.String(""), nil) |
| 266 | functionFrame.Type = dagql.NewResultCallType((&Function{}).Type()) |
| 267 | |
| 268 | tests := []struct { |
| 269 | name string |
| 270 | frame *dagql.ResultCall |
| 271 | want bool |
| 272 | }{ |
| 273 | { |
| 274 | name: "root currentTypeDefs", |
| 275 | frame: testResultCall("currentTypeDefs", dagql.String(""), nil), |
| 276 | want: true, |
| 277 | }, |
| 278 | { |
| 279 | name: "root plain field", |
| 280 | frame: testResultCall("plain", dagql.String(""), nil), |
| 281 | want: false, |
| 282 | }, |
| 283 | { |
| 284 | name: "function builder field", |
| 285 | frame: testResultCall("withArg", dagql.String(""), functionFrame), |
| 286 | want: true, |
| 287 | }, |
| 288 | { |
| 289 | name: "descendant of introspection root", |
| 290 | frame: testResultCall("name", dagql.String(""), testResultCall("currentTypeDefs", dagql.String(""), nil)), |
| 291 | want: true, |
| 292 | }, |
| 293 | { |
| 294 | name: "descendant of plain root", |
| 295 | frame: testResultCall("name", dagql.String(""), testResultCall("plain", dagql.String(""), nil)), |
| 296 | want: false, |
| 297 | }, |
| 298 | } |
| 299 | |
| 300 | for _, tc := range tests { |
| 301 | t.Run(tc.name, func(t *testing.T) { |
| 302 | require.Equal(t, tc.want, isIntrospection(ctx, tc.frame)) |
| 303 | }) |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | type telemetryTestNoopResolver struct{} |
| 308 |
nothing calls this directly
no test coverage detected