Skip to content

Commit 59760a8

Browse files
committed
test here doc on lexer
1 parent f74c40a commit 59760a8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/stringTests.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,33 @@ describe('Test strings', function() {
6969
it('...', function() {
7070
var ast = parser.parseEval('return "Class.create(\'$package$className\',{";');
7171
});
72+
it('heredoc ...', function() {
73+
var ast = parser.parseEval([
74+
'$code = <<<EOFX',
75+
'',
76+
'/*{$this->docStar}',
77+
' * Constructor.',
78+
' */',
79+
'public function __construct()',
80+
'{{$targetDirs}',
81+
'EOFX;'
82+
].join('\r\n'));
83+
});
84+
it('heredoc ...', function() {
85+
var ast = parser.parseEval([
86+
'$code .= <<<\'EOF\'',
87+
' }',
88+
'EOF;'
89+
].join('\r\n'));
90+
});
91+
it('heredoc ...', function() {
92+
var ast = parser.parseEval([
93+
'$fallbackContent .= sprintf(<<<EOF2',
94+
'\\$catalogue%s = new MessageCatalogue(\'%s\', %s);',
95+
'\\$catalogue%s->addFallbackCatalogue(\\$catalogue%s);',
96+
'EOF2',
97+
');',
98+
].join('\r\n'));
99+
});
100+
72101
});

0 commit comments

Comments
 (0)