| 1296 | } |
| 1297 | |
| 1298 | func (ContainerSuite) TestWorkdir(ctx context.Context, t *testctx.T) { |
| 1299 | res, err := testutil.Query[struct { |
| 1300 | Container struct { |
| 1301 | From struct { |
| 1302 | Workdir string |
| 1303 | WithExec struct { |
| 1304 | Stdout string |
| 1305 | } |
| 1306 | } |
| 1307 | } |
| 1308 | }](t, |
| 1309 | `{ |
| 1310 | container { |
| 1311 | from(address: "golang:1.18.2-alpine") { |
| 1312 | workdir |
| 1313 | withExec(args: ["pwd"]) { |
| 1314 | stdout |
| 1315 | } |
| 1316 | } |
| 1317 | } |
| 1318 | }`, nil) |
| 1319 | require.NoError(t, err) |
| 1320 | require.Equal(t, res.Container.From.Workdir, "/go") |
| 1321 | require.Equal(t, res.Container.From.WithExec.Stdout, "/go\n") |
| 1322 | } |
| 1323 | |
| 1324 | func (ContainerSuite) TestWithWorkdir(ctx context.Context, t *testctx.T) { |
| 1325 | res, err := testutil.Query[struct { |