From ec1571d26135712ffcc60930784bdc237f4da17f Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 28 Nov 2021 01:10:21 +0200 Subject: [PATCH] Adjust link test to account for colors --- src/Psalm/Report/ConsoleReport.php | 4 ++-- tests/ReportOutputTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Psalm/Report/ConsoleReport.php b/src/Psalm/Report/ConsoleReport.php index 7251ae4b4fe..cd0783b05f3 100644 --- a/src/Psalm/Report/ConsoleReport.php +++ b/src/Psalm/Report/ConsoleReport.php @@ -124,9 +124,9 @@ private function getFileReference($data): string $file_path = substr($data->file_name, 0, -strlen($file_basename)); $reference = $file_path - . "\e[1;31m" + . "\033[1;31m" . $file_basename . ':' . $data->line_from . ':' . $data->column_from - . "\e[0m" + . "\033[0m" ; if (null === $this->link_format) { diff --git a/tests/ReportOutputTest.php b/tests/ReportOutputTest.php index 232ef2b3f16..293dda96827 100644 --- a/tests/ReportOutputTest.php +++ b/tests/ReportOutputTest.php @@ -1079,7 +1079,7 @@ public function testConsoleReportWithLinks(): void $output = IssueBuffer::getOutput(IssueBuffer::getIssuesData(), $console_report_options); $this->assertStringContainsString( - "\033]8;;file://somefile.php#L3\033\\somefile.php:3:10\033]8;;\033\\", + "\033]8;;file://somefile.php#L3\033\\\033[1;31msomefile.php:3:10\033[0m\033]8;;\033\\", $output ); }