Skip to content

Commit

Permalink
color formatter now matches on beginning-of-line (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
aripringle authored Mar 26, 2019
1 parent 03add4b commit 51caae7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DiabloMedia/PHPUnit/Printer/PrettyPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ protected function formatExceptionMsg(string $exceptionMessage): string

if ($this->colors) {
$exceptionMessage = preg_replace('/^(Exception.*)$/m', "\033[01;31m$1\033[0m", $exceptionMessage) ?? '';
$exceptionMessage = preg_replace('/(Failed.*)$/m', "\033[01;31m$1\033[0m", $exceptionMessage) ?? '';
$exceptionMessage = preg_replace("/(\-+.*)$/m", "\033[01;32m$1\033[0m", $exceptionMessage) ?? '';
$exceptionMessage = preg_replace("/(\++.*)$/m", "\033[01;31m$1\033[0m", $exceptionMessage) ?? '';
$exceptionMessage = preg_replace('/^(Failed.*)$/m', "\033[01;31m$1\033[0m", $exceptionMessage) ?? '';
$exceptionMessage = preg_replace("/^(\-+.*)$/m", "\033[01;32m$1\033[0m", $exceptionMessage) ?? '';
$exceptionMessage = preg_replace("/^(\++.*)$/m", "\033[01;31m$1\033[0m", $exceptionMessage) ?? '';
}

return $exceptionMessage;
Expand Down

0 comments on commit 51caae7

Please sign in to comment.