(t *testing.T, srcDir string, args ...string)
| 313 | } |
| 314 | |
| 315 | func runTest(t *testing.T, srcDir string, args ...string) testRun { |
| 316 | t.Helper() |
| 317 | srcDir = filepath.FromSlash(srcDir) |
| 318 | res := testRun{ |
| 319 | t: t, |
| 320 | workDir: t.TempDir(), |
| 321 | srcDir: srcDir, |
| 322 | } |
| 323 | err := copyDir(t, res.workDir, srcDir) |
| 324 | if err != nil { |
| 325 | t.Error(err) |
| 326 | return res |
| 327 | } |
| 328 | res.err = run( |
| 329 | append(args, "-C", res.workDir), |
| 330 | []kong.Option{kong.Writers(&res.stdOut, &res.stdErr)}, |
| 331 | ) |
| 332 | return res |
| 333 | } |
| 334 | |
| 335 | func newTestServer(t *testing.T, ref string, files map[string]any) *httptest.Server { |
| 336 | t.Helper() |
no test coverage detected
searching dependent graphs…