(t *testing.T)
| 331 | } |
| 332 | |
| 333 | func TestGetFile_archive(t *testing.T) { |
| 334 | ctx := context.Background() |
| 335 | |
| 336 | dst := testing_helper.TempTestFile(t) |
| 337 | defer os.RemoveAll(filepath.Dir(dst)) |
| 338 | u := testModule("basic-file-archive/archive.tar.gz") |
| 339 | |
| 340 | op, err := GetFile(ctx, dst, u) |
| 341 | if err != nil { |
| 342 | t.Fatalf("err: %s", err) |
| 343 | } |
| 344 | if diff := cmp.Diff(&GetResult{Dst: dst}, op); diff != "" { |
| 345 | t.Fatalf("unexpected op: %s", diff) |
| 346 | } |
| 347 | |
| 348 | // Verify the main file exists |
| 349 | testing_helper.AssertContents(t, dst, "Hello\n") |
| 350 | } |
| 351 | func TestGetFile_filename_path_traversal(t *testing.T) { |
| 352 | dst := testing_helper.TempDir(t) |
| 353 | u := testModule("basic-file/foo.txt") |
nothing calls this directly
no test coverage detected