Skip to content

Commit 773a037

Browse files
committed
test: Don't look for a specfic ANSI color
1 parent 4e0a4cf commit 773a037

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/testsuite/message_format.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ fn cargo_renders_ansi() {
120120

121121
p.cargo("check --message-format json-diagnostic-rendered-ansi")
122122
.with_status(101)
123-
.with_stdout_contains("[..]\\u001b[38;5;9merror[..]")
123+
// Because 1b is the start of an ANSI escape sequence, checking for it
124+
// allows us to verify that ANSI colors are being emitted without
125+
// looking for specific color codes, that may change over time.
126+
.with_stdout_contains("[..]\\u001b[..]")
124127
.run();
125128
}
126129

0 commit comments

Comments
 (0)