File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,51 @@ function foo() {
176176 $ this ->_testFallbackFromParser ($ incompleteContents , $ validContents );
177177 }
178178
179+ public function testMissingSemicolon () {
180+ ASTConverter::set_should_add_placeholders (false );
181+ $ incompleteContents = <<<'EOT'
182+ <?php
183+ function foo() {
184+ $y = 3
185+ $x = intdiv(3, 2);
186+ }
187+ EOT;
188+ $ validContents = <<<'EOT'
189+ <?php
190+ function foo() {
191+ $y = 3;
192+ $x = intdiv(3, 2);
193+ }
194+ EOT;
195+ $ this ->_testFallbackFromParser ($ incompleteContents , $ validContents );
196+ }
197+
198+ // Another test (Won't work with php-parser, might work with tolerant-php-parser
199+ /**
200+ $incompleteContents = <<<'EOT'
201+ <?php
202+ class C{
203+ public function foo() {
204+ $x = 3;
205+
206+
207+ public function bar() {
208+ }
209+ }
210+ EOT;
211+ $validContents = <<<'EOT'
212+ <?php
213+ class C{
214+ public function foo() {
215+ $x = 3;
216+ }
217+
218+ public function bar() {
219+ }
220+ }
221+ EOT;
222+ */
223+
179224 private function _testFallbackFromParser (string $ incompleteContents , string $ validContents ) {
180225 $ supports40 = ConversionTest::hasNativeASTSupport (40 );
181226 $ supports50 = ConversionTest::hasNativeASTSupport (50 );
You can’t perform that action at this time.
0 commit comments