(t *testing.T)
| 679 | } |
| 680 | |
| 681 | func (s gitignoreSeq) run(t *testing.T) { |
| 682 | t.Helper() |
| 683 | cleanup := func() { |
| 684 | _ = os.RemoveAll(filepathext.SmartJoin(s.dir, ".task")) |
| 685 | for name := range s.create { |
| 686 | _ = os.Remove(filepathext.SmartJoin(s.dir, name)) |
| 687 | } |
| 688 | for _, name := range s.artifacts { |
| 689 | _ = os.Remove(filepathext.SmartJoin(s.dir, name)) |
| 690 | } |
| 691 | for name, content := range s.restore { |
| 692 | writeFile(t, s.dir, name, content) |
| 693 | } |
| 694 | } |
| 695 | cleanup() |
| 696 | t.Cleanup(cleanup) |
| 697 | for name, content := range s.create { |
| 698 | writeFile(t, s.dir, name, content) |
| 699 | } |
| 700 | for _, step := range s.steps { |
| 701 | for name, content := range step.write { |
| 702 | writeFile(t, s.dir, name, content) |
| 703 | } |
| 704 | NewExecutorTest(t, |
| 705 | WithName(step.run), |
| 706 | WithExecutorOptions(task.WithDir(s.dir)), |
| 707 | WithTask(s.task), |
| 708 | ) |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | func TestGitignoreChecksum(t *testing.T) { //nolint:paralleltest // shares testdata/gitignore and mutates fixture files |
| 713 | gitignoreSeq{ |
no test coverage detected