summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/php/regression.t
blob: 35e1f3e1441adcdddffe45089e1ab6d14faf0291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestRequest;

plan tests => 1, need_php;

my $expected = <<EXPECT;
PHP Regression Test

<html>
<head>

*** Testing assignments and variable aliasing: ***<br>
This should read "blah": blah<br>
This should read "this is nifty": this is nifty<br>
*************************************************<br>

*** Testing integer operators ***<br>
Correct result - 8:  8<br>
Correct result - 8:  8<br>
Correct result - 2:  2<br>
Correct result - -2:  -2<br>
Correct result - 15:  15<br>
Correct result - 15:  15<br>
Correct result - 2:  2<br>
Correct result - 3:  3<br>
*********************************<br>

*** Testing real operators ***<br>
Correct result - 8:  8<br>
Correct result - 8:  8<br>
Correct result - 2:  2<br>
Correct result - -2:  -2<br>
Correct result - 15:  15<br>
Correct result - 15:  15<br>
Correct result - 2:  2<br>
Correct result - 3:  3<br>
*********************************<br>

*** Testing if/elseif/else control ***<br>

This  works<br>
this_still_works<br>
should_print<br>


*** Seriously nested if's test ***<br>
** spelling correction by kluzz **
Only two lines of text should follow:<br>
this should be displayed. should be:  \$i=1, \$j=0.  is:  \$i=1, \$j=0<br>
this is supposed to be displayed. should be:  \$i=2, \$j=4.  is:  \$i=2, \$j=4<br>
3 loop iterations should follow:<br>
2 4<br>
3 4<br>
4 4<br>
**********************************<br>

*** C-style else-if's ***<br>
This should be displayed<br>
*************************<br>

*** WHILE tests ***<br>
0 is smaller than 20<br>
1 is smaller than 20<br>
2 is smaller than 20<br>
3 is smaller than 20<br>
4 is smaller than 20<br>
5 is smaller than 20<br>
6 is smaller than 20<br>
7 is smaller than 20<br>
8 is smaller than 20<br>
9 is smaller than 20<br>
10 is smaller than 20<br>
11 is smaller than 20<br>
12 is smaller than 20<br>
13 is smaller than 20<br>
14 is smaller than 20<br>
15 is smaller than 20<br>
16 is smaller than 20<br>
17 is smaller than 20<br>
18 is smaller than 20<br>
19 is smaller than 20<br>
20 equals 20<br>
21 is greater than 20<br>
22 is greater than 20<br>
23 is greater than 20<br>
24 is greater than 20<br>
25 is greater than 20<br>
26 is greater than 20<br>
27 is greater than 20<br>
28 is greater than 20<br>
29 is greater than 20<br>
30 is greater than 20<br>
31 is greater than 20<br>
32 is greater than 20<br>
33 is greater than 20<br>
34 is greater than 20<br>
35 is greater than 20<br>
36 is greater than 20<br>
37 is greater than 20<br>
38 is greater than 20<br>
39 is greater than 20<br>
*******************<br>


*** Nested WHILEs ***<br>
Each array variable should be equal to the sum of its indices:<br>
\${test00}[0] = 0<br>
\${test00}[1] = 1<br>
\${test00}[2] = 2<br>
\${test01}[0] = 1<br>
\${test01}[1] = 2<br>
\${test01}[2] = 3<br>
\${test02}[0] = 2<br>
\${test02}[1] = 3<br>
\${test02}[2] = 4<br>
\${test10}[0] = 1<br>
\${test10}[1] = 2<br>
\${test10}[2] = 3<br>
\${test11}[0] = 2<br>
\${test11}[1] = 3<br>
\${test11}[2] = 4<br>
\${test12}[0] = 3<br>
\${test12}[1] = 4<br>
\${test12}[2] = 5<br>
\${test20}[0] = 2<br>
\${test20}[1] = 3<br>
\${test20}[2] = 4<br>
\${test21}[0] = 3<br>
\${test21}[1] = 4<br>
\${test21}[2] = 5<br>
\${test22}[0] = 4<br>
\${test22}[1] = 5<br>
\${test22}[2] = 6<br>
*********************<br>

*** hash test... ***<br>
commented out...
**************************<br>

*** Hash resizing test ***<br>
ba<br>
baa<br>
baaa<br>
baaaa<br>
baaaaa<br>
baaaaaa<br>
baaaaaaa<br>
baaaaaaaa<br>
baaaaaaaaa<br>
baaaaaaaaaa<br>
ba<br>
10<br>
baa<br>
9<br>
baaa<br>
8<br>
baaaa<br>
7<br>
baaaaa<br>
6<br>
baaaaaa<br>
5<br>
baaaaaaa<br>
4<br>
baaaaaaaa<br>
3<br>
baaaaaaaaa<br>
2<br>
baaaaaaaaaa<br>
1<br>
**************************<br>


*** break/continue test ***<br>
\$i should go from 0 to 2<br>
\$j should go from 3 to 4, and \$q should go from 3 to 4<br>
  \$j=3<br>
    \$q=3<br>
    \$q=4<br>
  \$j=4<br>
    \$q=3<br>
    \$q=4<br>
\$j should go from 0 to 2<br>
  \$j=0<br>
  \$j=1<br>
  \$j=2<br>
\$k should go from 0 to 2<br>
    \$k=0<br>
    \$k=1<br>
    \$k=2<br>
\$i=0<br>
\$j should go from 3 to 4, and \$q should go from 3 to 4<br>
  \$j=3<br>
    \$q=3<br>
    \$q=4<br>
  \$j=4<br>
    \$q=3<br>
    \$q=4<br>
\$j should go from 0 to 2<br>
  \$j=0<br>
  \$j=1<br>
  \$j=2<br>
\$k should go from 0 to 2<br>
    \$k=0<br>
    \$k=1<br>
    \$k=2<br>
\$i=1<br>
\$j should go from 3 to 4, and \$q should go from 3 to 4<br>
  \$j=3<br>
    \$q=3<br>
    \$q=4<br>
  \$j=4<br>
    \$q=3<br>
    \$q=4<br>
\$j should go from 0 to 2<br>
  \$j=0<br>
  \$j=1<br>
  \$j=2<br>
\$k should go from 0 to 2<br>
    \$k=0<br>
    \$k=1<br>
    \$k=2<br>
\$i=2<br>
***********************<br>

*** Nested file include test ***<br>
<html>
This is Finish.phtml.  This file is supposed to be included
from regression_test.phtml.  This is normal HTML.
and this is PHP code, 2+2=4
</html>
********************************<br>

Tests completed.<br>
Limor Ullmann is now Limor Baruch :I

EXPECT

my $result = GET_BODY "/php/regression.php";

ok $result eq $expected;