(t *testing.T, dir, mainBody string)
| 11 | ) |
| 12 | |
| 13 | func writeModule(t *testing.T, dir, mainBody string) { |
| 14 | t.Helper() |
| 15 | if err := os.WriteFile(filepath.Join(dir, "go.mod"), []byte("module m\n\ngo 1.26\n"), 0o644); err != nil { |
| 16 | t.Fatalf("go.mod: %v", err) |
| 17 | } |
| 18 | if err := os.WriteFile(filepath.Join(dir, "main.go"), []byte(mainBody), 0o644); err != nil { |
| 19 | t.Fatalf("main.go: %v", err) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func TestBuildSuccess(t *testing.T) { |
| 24 | dir := t.TempDir() |
no outgoing calls
no test coverage detected