Skip to content

Commit 693e1be

Browse files
committed
Align hex dumps in mbstring unit test failure message for easy comparison
When developing mbstring, and a unit test fails, this will make it easier and quicker to identify the cause of the test failure.
1 parent 5455c3f commit 693e1be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mbstring/tests/encoding_tests.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function identifyInvalidString($badString, $encoding) {
9090
function testConversion($fromString, $toString, $fromEncoding, $toEncoding) {
9191
$result = mb_convert_encoding($fromString, $toEncoding, $fromEncoding);
9292
if ($result !== $toString) {
93-
echo "mb_convert_encoding not working on $fromEncoding input: " . dbgPrint($fromString) . "\nExpected $toEncoding: " . dbgPrint($toString) . "\nActually got: " . dbgPrint($result) . PHP_EOL;
93+
echo "mb_convert_encoding not working on $fromEncoding input: " . dbgPrint($fromString) . "\nExpected $toEncoding: " . dbgPrint($toString) . "\nActually got: " . str_repeat(' ', strlen($toEncoding) - 3) . dbgPrint($result) . PHP_EOL;
9494
testFailedIncrement();
9595
}
9696
}

0 commit comments

Comments
 (0)