5 unshift @INC, '../lib';
7 $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
11 $runme = ($^O eq 'VMS' ? 'MCR ' : '') . $^X;
16 open OP, qq{$runme -le "print 'aaa Ok ok' for 1..100"|};
18 @chopar = (113 .. 119);
26 @simple_input = grep /^\s*\w+\s*\$\w+\s*[#\n]/, @INPUT;
27 print "1..", (8 + @INPUT + @simple_input), "\n";
32 # Check correct optimization of ucfirst etc
36 print "not " unless $b eq 'Ab';
39 # Check correct destruction of objects:
41 sub A::DESTROY {$dc += 1}
44 { my $c = 6; $b = bless \$c, "A"}
47 print "not " unless $dc == 0;
53 print "not " unless $dc == 1;
56 { # Check calling STORE
58 sub B::TIESCALAR {bless [11], 'B'}
59 sub B::FETCH { -(shift->[0]) }
60 sub B::STORE { $sc++; my $o = shift; $o->[0] = 17 + shift }
67 print "not " unless $sc == 1;
74 print "not " unless $sc == 2;
78 print "# $m\nnot " unless $m == -117;
84 print "not " unless $sc == 3;
88 print "# $m\nnot " unless $m == 89;
95 ($op, undef, $comment) = /^([^\#]+)(\#\s+(.*))?/;
96 $comment = $op unless defined $comment;
97 $op = "$op==$op" unless $op =~ /==/;
98 ($op, $expectop) = $op =~ /(.*)==(.*)/;
100 $skip = ($op =~ /^'\?\?\?'/ or $comment =~ /skip\(.*\Q$^O\E.*\)/i)
102 $integer = ($comment =~ /^i_/) ? "use integer" : '' ;
103 (print "#skipping $comment:\nok $ord\n"), next if $skip eq 'skip';
106 local \$SIG{__WARN__} = \\&wrn;
112 print "# \$comment: got `\$a', expected `\$b'\n";
113 print "\$skip " if \$a ne \$b or \$skip eq 'skip';
118 if ($@ =~ /is unimplemented/) {
119 print "# skipping $comment: unimplemented:\nok $ord\n";
122 print "not ok $ord\n";
127 for (@simple_input) {
129 ($op, undef, $comment) = /^([^\#]+)(\#\s+(.*))?/;
130 $comment = $op unless defined $comment;
131 ($operator, $variable) = /^\s*(\w+)\s*\$(\w+)/ or warn "misprocessed '$_'\n";
133 local \$SIG{__WARN__} = \\&wrn;
134 my \$$variable = "Ac# Ca\\nxxx";
135 \$$variable = $operator \$$variable;
136 \$toself = \$$variable;
137 \$direct = $operator "Ac# Ca\\nxxx";
138 print "# \\\$$variable = $operator \\\$$variable\\nnot "
139 unless \$toself eq \$direct;
143 if ($@ =~ /is unimplemented/) {
144 print "# skipping $comment: unimplemented:\nok $ord\n";
145 } elsif ($@ =~ /Can't (modify|take log of 0)/) {
146 print "# skipping $comment: syntax not good for selfassign:\nok $ord\n";
149 print "not ok $ord\n";
155 ref $cstr # ref nonref
156 `$runme -e "print qq[1\n]"` # backtick skip(MSWin32)
157 `$undefed` # backtick undef skip(MSWin32)
161 (@z = (1 .. 3)) # aassign
163 (chop (@x=@chopar)) # schop
164 chomp $chopit # chomp
165 (chop (@x=@chopar)) # schomp
167 pos $chopit # pos returns undef
185 $n . $a=='2fake' # concat with self
186 "3$a"=='3fake' # concat with self in stringify
188 $n << $n # left_shift
189 $n >> $n # right_shift
210 length $posstr # length
211 substr $posstr, 2, 2 # substr
213 index $posstr, 2 # index
214 rindex $posstr, 2 # rindex
215 sprintf "%i%i", $n, $n # sprintf
219 ucfirst ($cstr . "a") # ucfirst padtmp
220 ucfirst $cstr # ucfirst
221 lcfirst $cstr # lcfirst
224 quotemeta $cstr # quotemeta
226 @$undefed # rv2av undef
231 pack "C2", $n,$n # pack
232 split /a/, "abad" # split
235 unshift @aaa # unshift
237 reverse $cstr # reverse - scal
238 grep $_, 1,0,2,0,3 # grepwhile
239 map "x$_", 1,0,2,0,3 # mapwhile
242 warn "ignore this\n" # warn
244 open BLAH, "<non-existent" # open
245 fileno STDERR # fileno
247 select STDOUT # sselect
248 select "","","",0 # select
265 chdir 'non-existent' # chdir
268 unlink 'non-existent' # unlink
269 chmod 'non-existent' # chmod
270 utime 'non-existent' # utime
271 rename 'non-existent', 'non-existent1' # rename
272 link 'non-existent', 'non-existent1' # link
274 readlink 'non-existent', 'non-existent1' # readlink
281 system "$runme -e 0" # system skip(VMS)
287 getpriority $$, $$ # getpriority
290 localtime $^T # localtime