(t *testing.T)
| 203 | } |
| 204 | } |
| 205 | |
| 206 | func TestEditFileDelete(t *testing.T) { |
| 207 | dir := t.TempDir() |
| 208 | path := filepath.Join(dir, "f.txt") |
| 209 | if err := os.WriteFile(path, []byte("alpha beta gamma"), 0o644); err != nil { |
| 210 | t.Fatal(err) |
| 211 | } |
| 212 | s := EditFile(path, "beta ", "") |
| 213 | if !strings.HasPrefix(s, "edited") { |
| 214 | t.Fatalf("bad: %q", s) |
| 215 | } |
| 216 | got, _ := os.ReadFile(path) |
| 217 | if string(got) != "alpha gamma" { |
| 218 | t.Fatalf("content wrong: %q", got) |
| 219 | } |
| 220 | } |
nothing calls this directly
no test coverage detected