diff --git a/tests/testsuite/message_format.rs b/tests/testsuite/message_format.rs index 7aefa68999c..3cbaf6f2238 100644 --- a/tests/testsuite/message_format.rs +++ b/tests/testsuite/message_format.rs @@ -120,7 +120,10 @@ fn cargo_renders_ansi() { p.cargo("check --message-format json-diagnostic-rendered-ansi") .with_status(101) - .with_stdout_contains("[..]\\u001b[38;5;9merror[..]") + // Because 1b is the start of an ANSI escape sequence, checking for it + // allows us to verify that ANSI colors are being emitted without + // looking for specific color codes, that may change over time. + .with_stdout_contains("[..]\\u001b[..]") .run(); }