Parse sscanf stuff from php tests

I originally just started copying their script which transforms %s to a regex, then run the regex. Then I realized their script does a ton more than they use in their test and was getting super compliected. This simple walking parser seems to do the trick. Escaping the regex for python's re was also being difficult.

This got us 145 more tests. yay.
Esse commit está contido em:
ptarjan
2013-04-01 01:01:48 -07:00
commit de Sara Golemon
commit 5a094b72f2
282 arquivos alterados com 214 adições e 323 exclusões
-14
Ver Arquivo
@@ -1,14 +0,0 @@
Strict Standards: Non-static method foo::bar() should not be called statically in hphp/test/zend/bad/009.php on line %d
string(3) "foo"
Strict Standards: Non-static method foo::bar() should not be called statically in hphp/test/zend/bad/009.php on line %d
string(3) "foo"
string(3) "foo"
string(3) "foo"
HipHop Warning: get_class() called without object from outside a class in hphp/test/zend/bad/009.php on line %d
bool(false)
HipHop Warning: get_class() expects parameter 1 to be object, string given in hphp/test/zend/bad/009.php on line %d
bool(false)
string(3) "foo"
string(4) "foo2"
Done
@@ -1 +0,0 @@
HipHop Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in hphp/test/zend/bad/abstract-methods05.php on line %d
@@ -1 +0,0 @@
HipHop Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in hphp/test/zend/bad/abstract-methods06.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Static function TestClass::getName() should not be abstract in %sabstract-static.php on line %d
===DONE===
@@ -1 +0,0 @@
Strict Standards: Declaration of Sub::test() should be compatible with & Base::test($foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_001.php on line %d
@@ -1 +0,0 @@
Strict Standards: Declaration of Sub::test() should be compatible with Base::test($foo, array &$bar, $option = NULL, $extra = 3.1415926535898) in %sargument_restriction_002.php on line %d
@@ -1 +0,0 @@
Strict Standards: Declaration of Sub::test() should be compatible with Base::test(Foo $foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_003.php on line %d
@@ -1 +0,0 @@
Strict Standards: Declaration of Sub::test() should be compatible with Base::test($foo, $extra = Array) in %sargument_restriction_006.php on line %d
@@ -1,3 +0,0 @@
3
Catchable fatal error: Argument 1 passed to foo() must be of the type array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
===DONE===
-10
Ver Arquivo
@@ -1,10 +0,0 @@
foo: foo foo2
bar: bar
HipHop Notice: Undefined property: bar::$foo2 in hphp/test/zend/bad/bug29689.php on line %d
---baz--
foo: foo foo2
bar: baz baz2
---baz2--
foo: foo foo2
bar2: baz2 baz22
-5
Ver Arquivo
@@ -1,5 +0,0 @@
Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 7
Blah::$x = 1
Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 10
$this->x = 5
-3
Ver Arquivo
@@ -1,3 +0,0 @@
Strict Standards: Only variables should be assigned by reference in %sbug31525.php on line 7
object(Foo)#1 (0) {
}
-7
Ver Arquivo
@@ -1,7 +0,0 @@
Strict Standards: Only variables should be passed by reference in %sbug33257.php on line 10
Array
(
[0] => a
[1] => b
[2] => c
)
-10
Ver Arquivo
@@ -1,10 +0,0 @@
Array
(
[0] => main
)
Strict Standards: Only variables should be passed by reference in %sbug35393.php on line 12
Array
(
[0] => main
)
-1
Ver Arquivo
@@ -1 +0,0 @@
Catched: Error occuried: Non-static method TestClass::testMethod() should not be called statically
-1
Ver Arquivo
@@ -1 +0,0 @@
OK
-4
Ver Arquivo
@@ -1,4 +0,0 @@
HipHop Notice: Indirect modification of overloaded property test::$anything has no effect in %sbug39775.php on line 10
Array
(
)
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Allowed memory size of 8388608 bytes exhausted%s(tried to allocate %d bytes) in hphp/test/zend/bad/bug40770.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Cannot use Blah\Ex as Ex because the name is already in use in %sbug42859.php on line 6
-1
Ver Arquivo
@@ -1 +0,0 @@
ok
-26
Ver Arquivo
@@ -1,26 +0,0 @@
Class [ <user> class x extends c implements a, b ] {
@@ %s 15-17
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Methods [2] {
Method [ <user, prototype b> public method foo ] {
@@ %s 16 - 16
}
Method [ <user, inherits c, prototype a> public method bar ] {
@@ %s 12 - 12
}
}
}
-2
Ver Arquivo
@@ -1,2 +0,0 @@
HipHop Warning: Class constants cannot be defined or redefined in %sbug44827.php on line %d
HipHop Warning: Class constants cannot be defined or redefined in %sbug44827.php on line %d
-8
Ver Arquivo
@@ -1,8 +0,0 @@
HipHop Fatal error: Uncaught exception 'RuntimeException' in %sbug45805.php:%d
Stack trace:
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(2048, 'Only variables ...', '%s', %d, Array)
#1 [internal function]: B->foo()
#2 %sbug45805.php(%d): ReflectionMethod->invoke(Object(B))
#3 %sbug45805.php(%d): B->bar()
#4 {main}
thrown in %sbug45805.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
BB
HipHop Fatal error: Class 'X' not found in %sbug47699.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
string(60) "Declaration of c::f() should be compatible with b::f($a = 1)"
-8
Ver Arquivo
@@ -1,8 +0,0 @@
%unicode|string%(9) "__call::a"
int(2)
%unicode|string%(9) "__call::c"
%unicode|string%(15) "__callStatic::a"
Strict Standards: Non-static method foo::b() should not be called statically in hphp/test/zend/bad/bug48533.php on line %d
int(2)
%unicode|string%(15) "__callStatic::c"
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Class A cannot implement both IteratorAggregate and Iterator at the same time in hphp/test/zend/bad/bug48667_1.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Class A cannot implement both Iterator and IteratorAggregate at the same time in hphp/test/zend/bad/bug48667_2.php on line %d
-4
Ver Arquivo
@@ -1,4 +0,0 @@
bool(false)
bool(false)
Catchable fatal error: Closure object cannot have properties in hphp/test/zend/bad/bug50146.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Declaration of Test::__construct() must be compatible with TestInterface::__construct(ExampleClass $var) in hphp/test/zend/bad/bug51421.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Redefining already defined constructor for class foo in hphp/test/zend/bad/bug52160.php on line %d
HipHop Fatal error: Constructor baz::baz() cannot be static in hphp/test/zend/bad/bug52160.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
HipHop Warning: Attempt to modify property of non-object in %sbug52237.php on line 3
string(4) "test"
-8
Ver Arquivo
@@ -1,8 +0,0 @@
Method [ <user> public method methodWithArgs ] {
@@ %sbug54305.php %d - %d
- Parameters [2] {
Parameter #0 [ <required> $a ]
Parameter #1 [ <required> $b ]
}
}
-2
Ver Arquivo
@@ -1,2 +0,0 @@
HipHop Notice: Undefined variable: cos in %sbug54585.php on line 3
ok
-6
Ver Arquivo
@@ -1,6 +0,0 @@
1
2
3
4
HipHop Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
Works
-5
Ver Arquivo
@@ -1,5 +0,0 @@
PRE-CLASS-GUARD
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/bug60536_002.php on line %d
POST-CLASS-GUARD
HipHop Fatal error: TraitsTest and THello1 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in hphp/test/zend/bad/bug60536_002.php on line %d
-5
Ver Arquivo
@@ -1,5 +0,0 @@
PRE-CLASS-GUARD
POST-CLASS-GUARD
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %sbug60536_004.php on line %d
POST-CLASS-GUARD2
-7
Ver Arquivo
@@ -1,7 +0,0 @@
PRE-CLASS-GUARD
Strict Standards: Base and THello1 define the same property ($hello) in the composition of SameNameInSubClassProducesNotice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/bug60536_005.php on line %d
POST-CLASS-GUARD
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/bug60536_005.php on line %d
POST-CLASS-GUARD2
-3
Ver Arquivo
@@ -1,3 +0,0 @@
Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = '123', $more = NULL) in %sbug63336.php on line %d
Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($var, $more = 'XXX') in %sbug63336.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Cannot destroy active lambda function in hphp/test/zend/bad/closure_017.php on line %d
@@ -1 +0,0 @@
HipHop Fatal error: Non-static method foo::foo() cannot be called statically in hphp/test/zend/bad/dynamic_call_001.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
HipHop Warning: test() has been disabled for security reasons in hphp/test/zend/bad/errmsg_021.php on line %d
Done
@@ -1,4 +0,0 @@
HipHop Notice: Undefined variable: blah in hphp/test/zend/bad/error_reporting09.php on line %d
HipHop Notice: Undefined variable: undef2 in hphp/test/zend/bad/error_reporting09.php on line %d
int(32767)
Done
-7
Ver Arquivo
@@ -1,7 +0,0 @@
HipHop Warning: Exception::getTraceAsString() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
HipHop Warning: Exception::__toString() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
HipHop Warning: Exception::getTrace() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
HipHop Warning: Exception::getLine() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
HipHop Warning: Exception::getFile() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
HipHop Warning: Exception::getMessage() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
HipHop Warning: Exception::getCode() expects exactly 0 parameters, 1 given in hphp/test/zend/bad/exception_010.php on line %d
@@ -1,3 +0,0 @@
HipHop Notice: Undefined variable: a in hphp/test/zend/bad/foreach_undefined.php on line %d
HipHop Warning: Invalid argument supplied for foreach() in hphp/test/zend/bad/foreach_undefined.php on line %d
Done
@@ -1,2 +0,0 @@
HipHop Warning: get_called_class() called from outside a class in hphp/test/zend/bad/get_called_class_001.php on line %d
bool(false)
@@ -1,17 +0,0 @@
array(1) {
["a"]=>
int(1)
}
array(3) {
["a"]=>
int(1)
["aa"]=>
int(4)
["cc"]=>
int(6)
}
HipHop Notice: Undefined property: C::$b in hphp/test/zend/bad/get_class_vars_002.php on line %d
HipHop Notice: Undefined property: C::$c in hphp/test/zend/bad/get_class_vars_002.php on line %d
int(1)
NULL
NULL
-2
Ver Arquivo
@@ -1,2 +0,0 @@
HipHop Notice: Constant __COMPILER_HALT_OFFSET__ already defined in hphp/test/zend/bad/halt_compiler3.php on line %d
==DONE==
-7
Ver Arquivo
@@ -1,7 +0,0 @@
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
Catchable fatal error: Object of class stdClass could not be converted to string in hphp/test/zend/bad/instanceof_001.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Hello World!Hello World!
HipHop Fatal error: Call to private method MyClass::sayHelloWorld() from context '' in hphp/test/zend/bad/language008b.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Trait T2 is not used in hphp/test/zend/bad/language017.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Cannot use 'final' as method modifier in hphp/test/zend/bad/language019.php on line %d
@@ -1,2 +0,0 @@
HipHop Warning: The magic method __set() must have public visibility and cannot be static in hphp/test/zend/bad/magic_methods_007.php on line %d
HipHop Fatal error: Method b::__set() must take exactly 2 arguments in hphp/test/zend/bad/magic_methods_007.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Trait 'THello' not found in hphp/test/zend/bad/missing-trait.php on line %d
-1
Ver Arquivo
@@ -1 +0,0 @@
5
-2
Ver Arquivo
@@ -1,2 +0,0 @@
HipHop Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2
-1
Ver Arquivo
@@ -1 +0,0 @@
HipHop Fatal error: Cannot redeclare constant 'NULL' in %sns_075.php on line %d
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo() in hphp/test/zend/bad/objects_002.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg) in hphp/test/zend/bad/objects_003.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg) in hphp/test/zend/bad/objects_004.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with & test::foo() in hphp/test/zend/bad/objects_005.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg, $arg2 = NULL) in hphp/test/zend/bad/objects_006.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg, &$arg2 = NULL) in hphp/test/zend/bad/objects_007.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo(Test $arg) in hphp/test/zend/bad/objects_008.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Declaration of test3::foo() should be compatible with test::foo(Test $arg) in hphp/test/zend/bad/objects_009.php on line %d
Done
-2
Ver Arquivo
@@ -1,2 +0,0 @@
Strict Standards: Redefining already defined constructor for class test in hphp/test/zend/bad/objects_010.php on line %d
Done
@@ -1,6 +0,0 @@
float(4308640384%d)
float(3545655%d)
float(262143)
float(549755813%d)
float(1884877076%d)
Done
-6
Ver Arquivo
@@ -1,6 +0,0 @@
PRE-CLASS-GUARD-TraitsTest
PRE-CLASS-GUARD-TraitsTest2
Strict Standards: THello1 and THello2 define the same property ($foo) in the composition of TraitsTest2. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/property001.php on line %d
bool(true)
bool(true)
-5
Ver Arquivo
@@ -1,5 +0,0 @@
PRE-CLASS-GUARD
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/property005.php on line %d
POST-CLASS-GUARD
HipHop Fatal error: TraitsTest and THello1 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in hphp/test/zend/bad/property005.php on line %d
-5
Ver Arquivo
@@ -1,5 +0,0 @@
PRE-CLASS-GUARD
POST-CLASS-GUARD
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/property006.php on line %d
POST-CLASS-GUARD2
-7
Ver Arquivo
@@ -1,7 +0,0 @@
PRE-CLASS-GUARD
Strict Standards: Base and THello1 define the same property ($hello) in the composition of SameNameInSubClassProducesNotice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/property007.php on line %d
POST-CLASS-GUARD
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in hphp/test/zend/bad/property007.php on line %d
POST-CLASS-GUARD2
+10
Ver Arquivo
@@ -0,0 +1,10 @@
string(3) "foo"
string(3) "foo"
string(3) "foo"
string(3) "foo"
HipHop Warning: get_class() called without object from outside a class in hphp/test/zend/good/009.php on line 21
bool(false)
bool(false)
string(3) "foo"
string(4) "foo2"
Done
@@ -0,0 +1 @@
===DONE===
@@ -0,0 +1,2 @@
3
HipHop Fatal error: Argument 1 passed to foo() must be an instance of array, int given in hphp/test/zend/good/array_type_hint_001.php on line 4
@@ -2,4 +2,3 @@ array(1) {
["public"]=>
string(6) "public"
}
+1
Ver Arquivo
@@ -0,0 +1 @@
===DONE===
+9
Ver Arquivo
@@ -0,0 +1,9 @@
foo: foo foo2
bar: bar HipHop Notice: Undefined property: bar::$foo2 in hphp/test/zend/good/bug29689.php on line 18
---baz--
foo: foo foo2
bar: baz baz2
---baz2--
foo: foo foo2
bar2: baz2 baz22

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais