diff --git a/test/PhpParser/ParserTest.php b/test/PhpParser/ParserTest.php index 8537594..3c52b58 100644 --- a/test/PhpParser/ParserTest.php +++ b/test/PhpParser/ParserTest.php @@ -124,6 +124,19 @@ EOC; $parser = new Parser($lexer); $parser->parse('dummy'); } + + public function testInvalidOctals() { + if (version_compare(PHP_VERSION, '7.0-dev', '>=')) { + $this->markTestSkipped('Cannot parse invalid octal numbers on PHP 7'); + } + + $parser = new Parser(new Lexer); + $stmts = $parser->parse('assertInstanceof($stmts[0], 'PhpParser\Scalar\LNumber'); + $this->assertInstanceof($stmts[1], 'PhpParser\Scalar\DNumber'); + $this->assertSame(7, $stmts[0]->value); + $this->assertSame(0xFFFFFFFFFFFFFFFF, $stmts[0]->value); + } } class InvalidTokenLexer extends Lexer { diff --git a/test/code/parser/scalar/float.test b/test/code/parser/scalar/float.test index c91b7ac..2c9d97e 100644 --- a/test/code/parser/scalar/float.test +++ b/test/code/parser/scalar/float.test @@ -18,7 +18,6 @@ Different float syntaxes 18446744073709551615; 0xFFFFFFFFFFFFFFFF; 01777777777777777777777; -0177777777777777777777787; 0b1111111111111111111111111111111111111111111111111111111111111111; ----- array( @@ -64,7 +63,4 @@ array( 13: Scalar_DNumber( value: @@{ 0xFFFFFFFFFFFFFFFF }@@ ) - 14: Scalar_DNumber( - value: @@{ 0xFFFFFFFFFFFFFFFF }@@ - ) -) \ No newline at end of file +) diff --git a/test/code/parser/scalar/int.test b/test/code/parser/scalar/int.test index 17a5785..38440c1 100644 --- a/test/code/parser/scalar/int.test +++ b/test/code/parser/scalar/int.test @@ -10,7 +10,6 @@ Different integer syntaxes 0xfff; 0XfFf; 0777; -0787; 0b111000111000; ----- array( @@ -39,9 +38,6 @@ array( value: 511 ) 8: Scalar_LNumber( - value: 7 - ) - 9: Scalar_LNumber( value: 3640 ) -) \ No newline at end of file +)