(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func initRulesCheckTestRepo(t *testing.T) string { |
| 15 | t.Helper() |
| 16 | repo := t.TempDir() |
| 17 | git := func(args ...string) { |
| 18 | t.Helper() |
| 19 | cmd := exec.Command("git", args...) |
| 20 | cmd.Dir = repo |
| 21 | if out, err := cmd.CombinedOutput(); err != nil { |
| 22 | t.Fatalf("git %v: %v\n%s", args, err, out) |
| 23 | } |
| 24 | } |
| 25 | git("init") |
| 26 | git("config", "user.email", "t@t.co") |
| 27 | git("config", "user.name", "t") |
| 28 | return repo |
| 29 | } |
| 30 | |
| 31 | func writeRulesCheckTestFile(t *testing.T, repo, relPath, content string) { |
| 32 | t.Helper() |
no outgoing calls
no test coverage detected