MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestInlineStatusEditFile

Function TestInlineStatusEditFile

internal/tools/edit_test.go:205–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

203 }
204}
205
206func 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}

Callers

nothing calls this directly

Calls 1

InlineStatusFunction · 0.85

Tested by

no test coverage detected