Skip to content

Commit

Permalink
Test line numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jan 26, 2025
1 parent 6a204ee commit fc246fa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/php/lang/ast/unittest/parse/LiteralsTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,30 @@ public function heredoc_indentation() {
);
$this->assertParsed([new Literal($nowdoc, self::LINE)], $nowdoc.';');
}

#[Test]
public function line_number_after_multiline_string() {
$string= (
"'<html>\n".
" ...\n".
"</html>'"
);
$this->assertParsed(
[new Literal($string, self::LINE), new Literal('null', self::LINE + 3)],
$string.";\nnull;"
);
}

#[Test]
public function line_number_after_heredoc() {
$nowdoc= (
"<<<EOD\n".
" Line 1\n".
" EOD"
);
$this->assertParsed(
[new Literal($nowdoc, self::LINE), new Literal('null', self::LINE + 3)],
$nowdoc.";\nnull;"
);
}
}

0 comments on commit fc246fa

Please sign in to comment.