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:
parent
3d62071f77
commit
ea744888ae
@ -203,6 +203,9 @@ func TestGitignoredTrackedWarning_FiresWhenTrackedFileMatchesGitignore(t *testin
|
|||||||
if !strings.Contains(out, "git rm --cached") {
|
if !strings.Contains(out, "git rm --cached") {
|
||||||
t.Errorf("warning should suggest `git rm --cached`, got: %q", out)
|
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) {
|
func TestGitignoredTrackedWarning_NoopWhenNothingMatches(t *testing.T) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user