diff --git a/cwriter/writer_posix_test.go b/cwriter/writer_posix_test.go index 42cc40e..e2a48a4 100644 --- a/cwriter/writer_posix_test.go +++ b/cwriter/writer_posix_test.go @@ -23,8 +23,10 @@ {input: "fizz\n", expectedOutput: "foo\n" + ClearCursorAndLine + "bar\n" + ClearCursorAndLine + "fizz\n"}, } { t.Run(tcase.input, func(t *testing.T) { - w.Write([]byte(tcase.input)) - w.Flush() + s := []byte(tcase.input) + lc := bytes.Count(s, []byte("\n")) + w.Write(s) + w.Flush(lc) output := out.String() if output != tcase.expectedOutput { t.Fatalf("want %q, got %q", tcase.expectedOutput, output)