From ef2608925c73430c25ad42a049a1039cd210ae67 Mon Sep 17 00:00:00 2001 From: Sander Roobol Date: Fri, 29 Mar 2002 17:12:11 +0000 Subject: [PATCH] Updating tests: remove alternative syntax in tests, added a special alternative-syntax testfile. --- tests/lang/002.phpt | 8 ++++--- tests/lang/003.phpt | 14 +++++++----- tests/lang/004.phpt | 10 +++++---- tests/lang/005.phpt | 13 ++++++----- tests/lang/006.phpt | 22 +++++++++++-------- tests/lang/007.phpt | 40 +++++++++++++++++++--------------- tests/lang/008.phpt | 20 ++++++++++------- tests/lang/009.phpt | 10 +++++---- tests/lang/010.phpt | 14 +++++++----- tests/lang/012.phpt | 12 +++++----- tests/lang/013.phpt | 6 ++--- tests/lang/014.phpt | 4 ++-- tests/lang/015.phpt | 4 ++-- tests/lang/016.inc | 6 ++--- tests/lang/016.phpt | 4 ++-- tests/lang/017.phpt | 16 ++++++++------ tests/lang/022.phpt | 4 ++-- tests/lang/025.phpt | 29 ++++++++++--------------- tests/lang/029.phpt | 6 +---- tests/lang/030.phpt | 17 ++++++++++----- tests/lang/031.phpt | 17 +++++++-------- tests/lang/033.phpt | 53 +++++++++++++++++++++++++++++++++++++++++++++ 22 files changed, 201 insertions(+), 128 deletions(-) create mode 100644 tests/lang/033.phpt diff --git a/tests/lang/002.phpt b/tests/lang/002.phpt index 9197a9762b..dd2c83b4f6 100644 --- a/tests/lang/002.phpt +++ b/tests/lang/002.phpt @@ -3,10 +3,12 @@ Simple While Loop Test --POST-- --GET-- --FILE-- - +} +?> --EXPECT-- 123456789 diff --git a/tests/lang/003.phpt b/tests/lang/003.phpt index 23bc99e9f4..cb2a3c38cd 100644 --- a/tests/lang/003.phpt +++ b/tests/lang/003.phpt @@ -3,17 +3,19 @@ Simple Switch Test --POST-- --GET-- --FILE-- - +} +?> --EXPECT-- good diff --git a/tests/lang/004.phpt b/tests/lang/004.phpt index be1f98ade5..bd47328c16 100644 --- a/tests/lang/004.phpt +++ b/tests/lang/004.phpt @@ -3,11 +3,13 @@ Simple If/Else Test --POST-- --GET-- --FILE-- - +} +?> --EXPECT-- good diff --git a/tests/lang/005.phpt b/tests/lang/005.phpt index ea413769b0..f74590e860 100644 --- a/tests/lang/005.phpt +++ b/tests/lang/005.phpt @@ -3,13 +3,16 @@ Simple If/ElseIf/Else Test --POST-- --GET-- --FILE-- - +} +?> --EXPECT-- good diff --git a/tests/lang/006.phpt b/tests/lang/006.phpt index b0cc9cf0e2..e9e8c2357f 100644 --- a/tests/lang/006.phpt +++ b/tests/lang/006.phpt @@ -3,19 +3,23 @@ Nested If/ElseIf/Else Test --POST-- --GET-- --FILE-- - + } +} +?> --EXPECT-- good diff --git a/tests/lang/007.phpt b/tests/lang/007.phpt index f0aa61f876..04af8111fd 100644 --- a/tests/lang/007.phpt +++ b/tests/lang/007.phpt @@ -3,23 +3,27 @@ Function call with global and static variables --POST-- --GET-- --FILE-- - + --EXPECT-- 1 5 2 2 10 5 2 5 3 2 10 5 3 5 4 2 diff --git a/tests/lang/008.phpt b/tests/lang/008.phpt index 145214cbb4..1e9c86ff5a 100644 --- a/tests/lang/008.phpt +++ b/tests/lang/008.phpt @@ -3,14 +3,18 @@ Testing recursive function --POST-- --GET-- --FILE-- - +function Test() +{ + static $a=1; + echo "$a "; + $a++; + if($a<10): Test(); endif; +} + +Test(); + +?> --EXPECT-- 1 2 3 4 5 6 7 8 9 diff --git a/tests/lang/009.phpt b/tests/lang/009.phpt index 5498288dcf..96278c22b1 100644 --- a/tests/lang/009.phpt +++ b/tests/lang/009.phpt @@ -3,9 +3,11 @@ Testing function parameter passing --POST-- --GET-- --FILE-- - + --EXPECT-- 3 diff --git a/tests/lang/010.phpt b/tests/lang/010.phpt index 03def4b112..e414baae6e 100644 --- a/tests/lang/010.phpt +++ b/tests/lang/010.phpt @@ -3,11 +3,13 @@ Testing function parameter passing with a return value --POST-- --GET-- --FILE-- - + --EXPECT-- 2 diff --git a/tests/lang/012.phpt b/tests/lang/012.phpt index b3c7abbfda..b54132b906 100644 --- a/tests/lang/012.phpt +++ b/tests/lang/012.phpt @@ -4,17 +4,17 @@ Testing stack after early function return --GET-- --FILE-- --EXPECT-- HelloHello diff --git a/tests/lang/013.phpt b/tests/lang/013.phpt index 74a8f197f1..4b661c071a 100644 --- a/tests/lang/013.phpt +++ b/tests/lang/013.phpt @@ -4,9 +4,9 @@ Testing eval function --GET-- --FILE-- --EXPECT-- Hello diff --git a/tests/lang/014.phpt b/tests/lang/014.phpt index a03aa47870..6338d7c23c 100644 --- a/tests/lang/014.phpt +++ b/tests/lang/014.phpt @@ -4,9 +4,9 @@ Testing eval function inside user-defined function --GET-- --FILE-- --EXPECT-- Hello diff --git a/tests/lang/016.inc b/tests/lang/016.inc index 7039e3f395..b73333f7b0 100755 --- a/tests/lang/016.inc +++ b/tests/lang/016.inc @@ -1,5 +1,5 @@ diff --git a/tests/lang/016.phpt b/tests/lang/016.phpt index 238fc29a61..49c4d4d1a6 100644 --- a/tests/lang/016.phpt +++ b/tests/lang/016.phpt @@ -4,8 +4,8 @@ Testing user-defined function in included file --GET-- --FILE-- --EXPECT-- Hello diff --git a/tests/lang/017.phpt b/tests/lang/017.phpt index 1fc8429a82..bb18194e5d 100644 --- a/tests/lang/017.phpt +++ b/tests/lang/017.phpt @@ -3,16 +3,18 @@ Testing user-defined function falling out of an If into another --POST-- --GET-- --FILE-- - +} +?> --EXPECT-- 1 diff --git a/tests/lang/022.phpt b/tests/lang/022.phpt index 1465396926..e1847b2c0e 100644 --- a/tests/lang/022.phpt +++ b/tests/lang/022.phpt @@ -7,7 +7,7 @@ Switch test 3 function switchtest ($i, $j) { - switch ($i): + switch ($i) { case 0: switch($j) { case 0: @@ -24,7 +24,7 @@ function switchtest ($i, $j) break; default: echo "Default taken\n"; - endswitch; + } } for ($i=0; $i<3; $i++) { for ($k=0; $k<10; $k++) { diff --git a/tests/lang/025.phpt b/tests/lang/025.phpt index 34e0e8d6f4..4f5397d5a8 100644 --- a/tests/lang/025.phpt +++ b/tests/lang/025.phpt @@ -4,24 +4,17 @@ Mean recursion test --GET-- --FILE-- diff --git a/tests/lang/029.phpt b/tests/lang/029.phpt index 6226d42880..4fcaa3811a 100644 --- a/tests/lang/029.phpt +++ b/tests/lang/029.phpt @@ -6,11 +6,7 @@ OO Bug Test (Bug #7515) root->set_in_copied_o=TRUE; - var_dump($o_copy);?>
root=new obj(); diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt index 162997fca9..ba809c8e31 100644 --- a/tests/lang/030.phpt +++ b/tests/lang/030.phpt @@ -8,13 +8,17 @@ class foo { function foo($name) { $GLOBALS['List']= &$this; $this->Name = $name; - $GLOBALS['List']->echoName(); } + $GLOBALS['List']->echoName(); + } function echoName() { - $GLOBALS['names'][]=$this->Name; } } + $GLOBALS['names'][]=$this->Name; + } +} -function &foo2(&$foo) { - return $foo; } +function &foo2(&$foo) { + return $foo; +} $bar1 =& new foo('constructor'); @@ -28,6 +32,7 @@ $bar1->echoName(); $List->echoName(); -print ($names==array('constructor','outside','outside','constructor','outside','outside')) ? 'success':'failure'; ?> +print ($names==array('constructor','outside','outside','constructor','outside','outside')) ? 'success':'failure'; +?> --EXPECT-- -success \ No newline at end of file +success diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt index b74d135748..bb3d776239 100644 --- a/tests/lang/031.phpt +++ b/tests/lang/031.phpt @@ -5,17 +5,16 @@ Internal hash position bug on assignment (Bug #16227) --FILE-- --EXPECT-- inloop 0 for key1 inloop 1 for key1 - diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt new file mode 100644 index 0000000000..0fb639ad53 --- /dev/null +++ b/tests/lang/033.phpt @@ -0,0 +1,53 @@ +--TEST-- +Alternative syntaxes test +--POST-- +--GET-- +--FILE-- + +--EXPECT-- +If: 11 +While: 12346789 +For: 0123401234 +Switch: 1 +old_function: foo(1, 2); -- 2.50.1