test(cli): lock in trailing newline on gitignored-tracked warning

Guards against a silent refactor from Fprintln to Fprint dropping the
terminating newline that downstream output relies on.
This commit is contained in:
Alex Dunmow 2026-06-03 10:14:06 +08:00
parent 3d62071f77
commit ea744888ae

View File

@ -203,6 +203,9 @@ func TestGitignoredTrackedWarning_FiresWhenTrackedFileMatchesGitignore(t *testin
if !strings.Contains(out, "git rm --cached") {
t.Errorf("warning should suggest `git rm --cached`, got: %q", out)
}
if !strings.HasSuffix(out, "\n") {
t.Errorf("warning should end with a newline (Fprintln), got: %q", out)
}
}
func TestGitignoredTrackedWarning_NoopWhenNothingMatches(t *testing.T) {