(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestHandleGitDiff(t *testing.T) { |
| 94 | dir := newGitRepo(t) |
| 95 | // Modify the tracked file so diff has content. |
| 96 | if err := os.WriteFile(filepath.Join(dir, "tracked.txt"), []byte("hello\nworld\n"), 0600); err != nil { |
| 97 | t.Fatal(err) |
| 98 | } |
| 99 | e, out := newGitTestEngine() |
| 100 | if err := e.Execute(context.Background(), "git-diff", []string{"--dir", dir, "--context", "1"}); err != nil { |
| 101 | t.Fatalf("git-diff: %v", err) |
| 102 | } |
| 103 | if !strings.Contains(out.String(), "world") { |
| 104 | t.Errorf("diff output = %q", out.String()) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func TestHandleGitDiff_NameOnlyAndStat(t *testing.T) { |
| 109 | dir := newGitRepo(t) |
nothing calls this directly
no test coverage detected