Skip to content

Commit 6c8d67b

Browse files
committed
STAC-23429 Trying something else to fix the printer test.
1 parent 8720e88 commit 6c8d67b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/printer/printer_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io"
77
"net/http"
88
"os"
9+
"regexp"
910
"strings"
1011
"testing"
1112

@@ -50,7 +51,9 @@ func TestPrintWithoutSymbolButWithColorOnWindows(t *testing.T) {
5051
// On Windows we don't use Unicode symbols, but colored text may vary by library/version.
5152
// Assert content is present and no unicode cross mark appears.
5253
s := stdErr.String()
53-
assert.Contains(t, s, "[ERROR] Test\n")
54+
ansi := regexp.MustCompile(`\x1b\[[0-9;]*m`)
55+
plain := ansi.ReplaceAllString(s, "")
56+
assert.Contains(t, plain, "[ERROR] Test\n")
5457
assert.NotContains(t, s, "\u274C")
5558
}
5659

0 commit comments

Comments
 (0)