5 unshift @INC, '../lib';
10 $runme = ($^O eq 'VMS' ? 'MCR ' : '') . $^X;
15 open OP, qq{$runme -le "print 'aaa Ok ok' for 1..100"|};
17 @chopar = (113 .. 119);
25 @simple_input = grep /^\s*\w+\s*\$\w+\s*[#\n]/, @INPUT;
26 print "1..", (8 + @INPUT + @simple_input), "\n";
31 # Check correct optimization of ucfirst etc
35 print "not " unless $b eq 'Ab';
38 # Check correct destruction of objects:
40 sub A::DESTROY {$dc += 1}
43 { my $c = 6; $b = bless \$c, "A"}
46 print "not " unless $dc == 0;
52 print "not " unless $dc == 1;
55 { # Check calling STORE
57 sub B::TIESCALAR {bless [11], 'B'}
58 sub B::FETCH { -(shift->[0]) }
59 sub B::STORE { $sc++; my $o = shift; $o->[0] = 17 + shift }
66 print "not " unless $sc == 1;
73 print "not " unless $sc == 2;
77 print "# $m\nnot " unless $m == -117;
83 print "not " unless $sc == 3;
87 print "# $m\nnot " unless $m == 89;
94 ($op, undef, $comment) = /^([^\#]+)(\#\s+(.*))?/;
95 $comment = $op unless defined $comment;
96 $op = "$op==$op" unless $op =~ /==/;
97 ($op, $expectop) = $op =~ /(.*)==(.*)/;
99 $skip = ($op =~ /^'\?\?\?'/ or $comment =~ /skip\(.*\Q$^O\E.*\)/i)
101 $integer = ($comment =~ /^i_/) ? "use integer" : '' ;
102 (print "#skipping $comment:\nok $ord\n"), next if $skip eq 'skip';
105 local \$SIG{__WARN__} = \\&wrn;
111 print "# \$comment: got `\$a', expected `\$b'\n";
112 print "\$skip " if \$a ne \$b or \$skip eq 'skip';
117 if ($@ =~ /is unimplemented/) {
118 print "# skipping $comment: unimplemented:\nok $ord\n";
121 print "not ok $ord\n";
126 for (@simple_input) {
128 ($op, undef, $comment) = /^([^\#]+)(\#\s+(.*))?/;
129 $comment = $op unless defined $comment;
130 ($operator, $variable) = /^\s*(\w+)\s*\$(\w+)/ or warn "misprocessed '$_'\n";
132 local \$SIG{__WARN__} = \\&wrn;
133 my \$$variable = "Ac# Ca\\nxxx";
134 \$$variable = $operator \$$variable;
135 \$toself = \$$variable;
136 \$direct = $operator "Ac# Ca\\nxxx";
137 print "# \\\$$variable = $operator \\\$$variable\\nnot "
138 unless \$toself eq \$direct;
142 if ($@ =~ /is unimplemented/) {
143 print "# skipping $comment: unimplemented:\nok $ord\n";
144 } elsif ($@ =~ /Can't (modify|take log of 0)/) {
145 print "# skipping $comment: syntax not good for selfassign:\nok $ord\n";
148 print "not ok $ord\n";
154 ref $cstr # ref nonref
155 `$runme -e "print qq[1\n]"` # backtick skip(MSWin32)
156 `$undefed` # backtick undef skip(MSWin32)
160 (@z = (1 .. 3)) # aassign
162 (chop (@x=@chopar)) # schop
163 chomp $chopit # chomp
164 (chop (@x=@chopar)) # schomp
166 pos $chopit # pos returns undef
184 $n . $a=='2fake' # concat with self
185 "3$a"=='3fake' # concat with self in stringify
187 $n << $n # left_shift
188 $n >> $n # right_shift
209 length $posstr # length
210 substr $posstr, 2, 2 # substr
212 index $posstr, 2 # index
213 rindex $posstr, 2 # rindex
214 sprintf "%i%i", $n, $n # sprintf
218 ucfirst ($cstr . "a") # ucfirst padtmp
219 ucfirst $cstr # ucfirst
220 lcfirst $cstr # lcfirst
223 quotemeta $cstr # quotemeta
225 @$undefed # rv2av undef
230 pack "C2", $n,$n # pack
231 split /a/, "abad" # split
234 unshift @aaa # unshift
236 reverse $cstr # reverse - scal
237 grep $_, 1,0,2,0,3 # grepwhile
238 map "x$_", 1,0,2,0,3 # mapwhile
241 warn "ignore this\n" # warn
243 open BLAH, "<non-existent" # open
244 fileno STDERR # fileno
246 select STDOUT # sselect
247 select "","","",0 # select
264 chdir 'non-existent' # chdir
267 unlink 'non-existent' # unlink
268 chmod 'non-existent' # chmod
269 utime 'non-existent' # utime
270 rename 'non-existent', 'non-existent1' # rename
271 link 'non-existent', 'non-existent1' # link
273 readlink 'non-existent', 'non-existent1' # readlink
280 system "$runme -e 0" # system skip(VMS)
286 getpriority $$, $$ # getpriority
289 localtime $^T # localtime