From 2eb8f5aa5ab551f9145eec0bb11351798f6f3b8d Mon Sep 17 00:00:00 2001 From: JP Appel Date: Wed, 9 Oct 2024 12:24:26 -0400 Subject: Change test to match correct AnsiFilterWriter behavior --- util/util_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/util_test.go') diff --git a/util/util_test.go b/util/util_test.go index fd9b7b8..9c5881d 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -53,8 +53,9 @@ func testAnsiFilterWriter(t *testing.T, input string, expected string) { t.Fatal("Error while writting input", err) } - if n != len(expected) { - t.Errorf("Expected to write %d bytes but read %d\n", len(expected), n) + // NOTE: we expect the size of input to be written to indicate those bytes have been consumed by the writer + if n != len(input) { + t.Errorf("Expected to write %d bytes but wrote %d\n", len(input), n) } result := writer.String() -- cgit v1.2.3