1. <GALiRe>
2.
3. <title>Privatization Test Suite<end title>
4. <stylesheet:http://www.globalaircraft.org/default.css;>
5.
6.
7. <bold fontsize:18;>Privatization Test<end bold><new><new>
8.
9. <%
10.
11. $z = "sad";
12. $x = "bob";
13.
14. private while ($x = 1 and $x < 3 and $x++) {
15. $z = "happy";
16. print "$x. $z (private)<new>";
17. }
18.
19. print "$z<new>";
20. print "$x<new>";
21. print "<color:green;>check<end color><line>";
22.
23. private method newName($x) {
24. $z = 5;
25. print "$x. $z<new>";
26.
27. }&newName(3);
28.
29. print "$z<new>";
30. print "$x<new>";
31. print "<color:green;>check<end color><line>";
32.
33. method different($x) {
34. while ($a = 0 and $a < 2 and $a++) {
35. $z = 5;
36. print "$x. $z<new>";
37. }
38. }&different(3);
39.
40. print "$z<new>";
41. print "$x<new>";
42. print "<color:green;>check<end color>";
43.
44.
45.
46. print "<line>";
47.
48. private method halfHalf($x) {
49. $z = 20;
50. print "$x. " + public $z + "<new>";
51.
52. }&halfHalf(10);
53.
54. method InsideOut($x) {
55. private $z = 20;
56. print "$x. $z<new>";
57. print "$x. " + private $z + "<new>";
58.
59. }&InsideOut(10);
60.
61. print "<color:green;>check<end color>";
62.
63.
64. %>
65.
66.
67.
68.
69.
70. <line><line>
71. <bold fontsize:18;>Class (OO) Test<end bold><new><new>
72.
73.
74. <%
75.
76. class MyFirstClass($takeIn) {
77. if ($takeIn eq "") {$takeIn=1;}
78. $i = 3;
79. method func($v) {
80. $g = solve($takeIn+$i+$v);
81. return $g;
82. }
83.
84. }
85.
86.
87. *Obj1 = *MyFirstClass(4);
88. print "*Obj1[$takeIn]<new>";
89. *Obj1[$i] = 2;
90. print "*Obj1[$i]<new>";
91. print *Obj1[&func(2)];
92.
93. print "<new><new>";
94.
95. *Obj2 = *MyFirstClass(9);
96. print "*Obj2[$takeIn]<new>";
97. print "*Obj2[$i]<new>";
98. print *Obj2[&func(2)];
99.
100. print "<new><new>";
101.
102. *Obj3 = *MyFirstClass;
103. print "*Obj3[$takeIn]<new>";
104. print "*Obj3[$i]<new>";
105. print *Obj3[&func(19)];
106.
107.
108. print "<new><color:green;>check<end color>";
109.
110.
111. %>
112.
113.
114.
115. <line><line>
116. <bold fontsize:18;>Break Privatization<end bold><new><new>
117.
118. <%
119.
120. private method clearMe() {
121. print "$x - ";
122. $x = 5;
123. print "$x<new>";
124. }
125.
126. &clearMe();
127. &clearMe();
128. print "<color:green;>check<end color><new><new>";
129.
130.
131.
132.
133. private while ($x = 1 and $x <= 3 and $x++) {
134. print "$x. $z<new>";
135. $z = "happy";
136. print "$x. $z<new>";
137. }
138.
139.
140. print "<color:green;>check<end color><new><new>";
141.
142.
143.
144. private method privFail($x) {
145. print "$x. $z<new>";
146. $z = "happy";
147. print "$x. $z<new>";
148. }&privFail(1);
149. &privFail(3);
150. print "<color:green;>check<end color><new><new>";
151.
152.
153.
154. print "$x<new>";
155. @arry=(1,2,3,4,5);
156. private while ($x = @arry) {
157. print "$x<new>";
158. }
159. print "$x<new>";
160. print "<color:green;>check<end color><new><new>";
161.
162.
163.
164. $x=1;
165. while ($x < 4) {
166. $x++;
167. private $x;
168. $x = 3;
169. print $x;
170. }
171. print "<new><color:green;>check<end color><new><new>";
172.
173.
174.
175. $x=1;
176. method clearItOutA() {
177. print "$x - ";
178. private $x = 5;
179. print "$x<new>";
180. }&clearItOutA();
181. &clearItOutA();
182.
183. print "<color:green;>check<end color><new><new>";
184.
185.
186. print "<line>";
187.
188.
189. while (private $x = @arry) {
190. print "$x<new>";
191. }
192. print "$x<new>";
193. print "<color:green;>check<end color><new><new>";
194.
195.
196.
197. $x=1;
198. method clearItOut(private $x) {
199. print "$x";
200. $x = 5;
201. print "$x<new>";
202. }&clearItOut(3);
203. &clearItOut(3);
204. print "$x<new>";
205. print "<color:green;>check<end color><new><new>";
206.
207.
208. $g = "XXX";
209. private while($g = 1 and $g < 3 and $g++) {
210. print $g;
211. while ($a = 1 and $a < 2 and $a++) {
212. print "($a$g)";
213. }
214. print "<new>";
215. }
216. print "<color:red;>fail<end color><new><new>";
217.
218.
219. %>
220.
221.
222.
223. <end GALiRe>
Back to /SampleHost/