Skip to content

Commit

Permalink
Fix: Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jan 3, 2023
1 parent adca8a8 commit f0ecca5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/Unit/PrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,29 @@ public function testPrintPrintsPrettyIdempotently(): void
self::assertSame($json, $printed);
}

public function testPrintRemovesTrailingEmptyLines(): void
{
$json = <<<'JSON'
{
"name": "Andreas Möller",
"emoji": "🤓",
"urls": [
"https://localheinz.com",
"https://github.com/localheinz",
"https://twitter.com/localheinz"
]
}


JSON;

$printer = new Printer();

$printed = $printer->print($json);

self::assertSame(\trim($json), $printed);
}

public function testPrintCollapsesEmptyArray(): void
{
$json = <<<'JSON'
Expand Down

0 comments on commit f0ecca5

Please sign in to comment.