Commit | Line | Data |
317982ac |
1 | #!./perl |
2 | |
3 | BEGIN { |
4 | chdir 't' if -d 't'; |
5 | @INC = '../lib'; |
6 | } |
7 | |
8 | umask 0; |
9 | $xref = \ ""; |
10 | @a = (1..5); |
11 | %h = (1..6); |
12 | $aref = \@a; |
13 | $href = \%h; |
712a1d74 |
14 | open OP, qq{$^X -le "print 'aaa Ok ok' for 1..100"|}; |
317982ac |
15 | $chopit = 'aaaaaa'; |
16 | @chopar = (113 .. 119); |
17 | $posstr = '123456'; |
18 | $cstr = 'aBcD.eF'; |
19 | pos $posstr = 3; |
20 | $nn = $n = 2; |
21 | sub subb {"in s"} |
22 | |
23 | @INPUT = <DATA>; |
24 | print "1..", (scalar @INPUT), "\n"; |
25 | $ord = 0; |
26 | |
27 | sub wrn {"@_"} |
28 | |
29 | for (@INPUT) { |
30 | $ord++; |
31 | ($op, undef, $comment) = /^([^\#]+)(\#\s+(.*))?/; |
32 | $comment = $op unless defined $comment; |
33 | $op = "$op==$op" unless $op =~ /==/; |
34 | ($op, $expectop) = $op =~ /(.*)==(.*)/; |
35 | |
0f4592ef |
36 | $skip = ($op =~ /^'\?\?\?'/ or $comment =~ /skip\(.*\Q$^O\E.*\)/i) |
37 | ? "skip" : "not"; |
317982ac |
38 | $integer = ($comment =~ /^i_/) ? "use integer" : '' ; |
39 | (print "#skipping $comment:\nok $ord\n"), next if $skip eq 'skip'; |
40 | |
41 | eval <<EOE; |
42 | local \$SIG{__WARN__} = \\&wrn; |
43 | my \$a = 'fake'; |
44 | $integer; |
45 | \$a = $op; |
46 | \$b = $expectop; |
47 | if (\$a ne \$b) { |
48 | print "# \$comment: got `\$a', expected `\$b'\n"; |
49 | print "\$skip " if \$a ne \$b or \$skip eq 'skip'; |
50 | } |
51 | print "ok \$ord\\n"; |
52 | EOE |
53 | if ($@) { |
54 | if ($@ =~ /is unimplemented/) { |
55 | print "# skipping $comment: unimplemented:\nok $ord\n"; |
56 | } else { |
57 | warn $@; |
58 | print "not ok $ord\n"; |
59 | } |
60 | } |
61 | } |
62 | __END__ |
63 | ref $xref # ref |
64 | ref $cstr # ref nonref |
0f4592ef |
65 | `ls` # backtick skip(MSWin32) |
66 | `$undefed` # backtick undef skip(MSWin32) |
317982ac |
67 | <*> # glob |
68 | <OP> # readline |
69 | 'faked' # rcatline |
70 | (@z = (1 .. 3)) # aassign |
71 | chop $chopit # chop |
72 | (chop (@x=@chopar)) # schop |
73 | chomp $chopit # chomp |
74 | (chop (@x=@chopar)) # schomp |
75 | pos $posstr # pos |
76 | pos $chopit # pos returns undef |
77 | $nn++==2 # postinc |
78 | $nn++==3 # i_postinc |
79 | $nn--==4 # postdec |
80 | $nn--==3 # i_postdec |
81 | $n ** $n # pow |
82 | $n * $n # multiply |
83 | $n * $n # i_multiply |
84 | $n / $n # divide |
85 | $n / $n # i_divide |
86 | $n % $n # modulo |
87 | $n % $n # i_modulo |
88 | $n x $n # repeat |
89 | $n + $n # add |
90 | $n + $n # i_add |
91 | $n - $n # subtract |
92 | $n - $n # i_subtract |
93 | $n . $n # concat |
94 | $n . $a=='2fake' # concat with self |
95 | "3$a"=='3fake' # concat with self in stringify |
96 | "$n" # stringify |
97 | $n << $n # left_shift |
98 | $n >> $n # right_shift |
99 | $n <=> $n # ncmp |
100 | $n <=> $n # i_ncmp |
101 | $n cmp $n # scmp |
102 | $n & $n # bit_and |
103 | $n ^ $n # bit_xor |
104 | $n | $n # bit_or |
105 | -$n # negate |
106 | -$n # i_negate |
107 | ~$n # complement |
108 | atan2 $n,$n # atan2 |
109 | sin $n # sin |
110 | cos $n # cos |
111 | '???' # rand |
112 | exp $n # exp |
113 | log $n # log |
114 | sqrt $n # sqrt |
115 | int $n # int |
116 | hex $n # hex |
117 | oct $n # oct |
118 | abs $n # abs |
119 | length $posstr # length |
120 | substr $posstr, 2, 2 # substr |
121 | vec("abc",2,8) # vec |
122 | index $posstr, 2 # index |
123 | rindex $posstr, 2 # rindex |
124 | sprintf "%i%i", $n, $n # sprintf |
125 | ord $n # ord |
126 | chr $n # chr |
127 | crypt $n, $n # crypt |
128 | ucfirst ($cstr . "a") # ucfirst padtmp |
129 | ucfirst $cstr # ucfirst |
130 | lcfirst $cstr # lcfirst |
131 | uc $cstr # uc |
132 | lc $cstr # lc |
133 | quotemeta $cstr # quotemeta |
134 | @$aref # rv2av |
135 | @$undefed # rv2av undef |
136 | each %h==1 # each |
137 | values %h # values |
138 | keys %h # keys |
139 | %$href # rv2hv |
140 | pack "C2", $n,$n # pack |
141 | split /a/, "abad" # split |
142 | join "a"; @a # join |
143 | push @a,3==6 # push |
144 | unshift @aaa # unshift |
145 | reverse @a # reverse |
146 | reverse $cstr # reverse - scal |
147 | grep $_, 1,0,2,0,3 # grepwhile |
148 | map "x$_", 1,0,2,0,3 # mapwhile |
149 | subb() # entersub |
150 | caller # caller |
151 | warn "ignore this\n" # warn |
152 | 'faked' # die |
153 | open BLAH, "<non-existent" # open |
154 | fileno STDERR # fileno |
155 | umask 0 # umask |
156 | select STDOUT # sselect |
157 | select "","","",0 # select |
158 | getc OP # getc |
159 | '???' # read |
160 | '???' # sysread |
161 | '???' # syswrite |
162 | '???' # send |
163 | '???' # recv |
164 | '???' # tell |
165 | '???' # fcntl |
166 | '???' # ioctl |
167 | '???' # flock |
168 | '???' # accept |
169 | '???' # shutdown |
170 | '???' # ftsize |
171 | '???' # ftmtime |
172 | '???' # ftatime |
173 | '???' # ftctime |
174 | chdir 'non-existent' # chdir |
175 | '???' # chown |
176 | '???' # chroot |
177 | unlink 'non-existent' # unlink |
178 | chmod 'non-existent' # chmod |
179 | utime 'non-existent' # utime |
180 | rename 'non-existent', 'non-existent1' # rename |
181 | link 'non-existent', 'non-existent1' # link |
ecece5d6 |
182 | '???' # symlink |
317982ac |
183 | readlink 'non-existent', 'non-existent1' # readlink |
184 | '???' # mkdir |
185 | '???' # rmdir |
186 | '???' # telldir |
187 | '???' # fork |
188 | '???' # wait |
189 | '???' # waitpid |
0f4592ef |
190 | system "$^X -e 0" # system |
317982ac |
191 | '???' # exec |
0f4592ef |
192 | '???' # kill |
317982ac |
193 | getppid # getppid |
194 | getpgrp # getpgrp |
195 | '???' # setpgrp |
196 | getpriority $$, $$ # getpriority |
197 | '???' # setpriority |
198 | time # time |
199 | localtime # localtime |
200 | gmtime # gmtime |
201 | sleep 1 # sleep |
202 | '???' # alarm |
203 | '???' # shmget |
204 | '???' # shmctl |
205 | '???' # shmread |
206 | '???' # shmwrite |
207 | '???' # msgget |
208 | '???' # msgctl |
209 | '???' # msgsnd |
210 | '???' # msgrcv |
211 | '???' # semget |
212 | '???' # semctl |
213 | '???' # semop |
214 | '???' # getlogin |
215 | '???' # syscall |