fix writer_posix_test
Vladimir Bauer
7 years ago
| 22 | 22 | {input: "fizz\n", expectedOutput: "foo\n" + ClearCursorAndLine + "bar\n" + ClearCursorAndLine + "fizz\n"}, |
| 23 | 23 | } { |
| 24 | 24 | t.Run(tcase.input, func(t *testing.T) { |
| 25 | w.Write([]byte(tcase.input)) | |
| 26 | w.Flush() | |
| 25 | s := []byte(tcase.input) | |
| 26 | lc := bytes.Count(s, []byte("\n")) | |
| 27 | w.Write(s) | |
| 28 | w.Flush(lc) | |
| 27 | 29 | output := out.String() |
| 28 | 30 | if output != tcase.expectedOutput { |
| 29 | 31 | t.Fatalf("want %q, got %q", tcase.expectedOutput, output) |