llvm-project
57dee481 - [Support] Fix SpecialCaseListTest.DotSlashWarning in a terminal (#244459)

Commit
1 day ago
[Support] Fix SpecialCaseListTest.DotSlashWarning in a terminal (#244459) raw_fd_ostream caches has_colors() on first use. When the suite runs with stderr on a terminal, DotSlash emits the deprecation warning uncaptured, so errs() caches colors as enabled. DotSlashWarning then captures stderr but still gets escape codes between "warning: " and the message, and its HasSubstr check fails. The test passes when run alone because the first check happens while stderr is captured. Disable WithColor's color auto-detection for the duration of the test.
Parents
Loading