xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/ext/Opcode/t/ops.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateBEGIN {
4*0Sstevel@tonic-gate    chdir 't' if -d 't';
5*0Sstevel@tonic-gate    @INC = '../lib';
6*0Sstevel@tonic-gate    require Config; import Config;
7*0Sstevel@tonic-gate    if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
8*0Sstevel@tonic-gate        print "1..0\n";
9*0Sstevel@tonic-gate        exit 0;
10*0Sstevel@tonic-gate    }
11*0Sstevel@tonic-gate}
12*0Sstevel@tonic-gate
13*0Sstevel@tonic-gateprint "1..2\n";
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gateeval <<'EOP';
16*0Sstevel@tonic-gate	no ops 'fileno';	# equiv to "perl -M-ops=fileno"
17*0Sstevel@tonic-gate	$a = fileno STDIN;
18*0Sstevel@tonic-gateEOP
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gateprint $@ =~ /trapped/ ? "ok 1\n" : "not ok 1\n# $@\n";
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gateeval <<'EOP';
23*0Sstevel@tonic-gate	use ops ':default';	# equiv to "perl -M(as above) -Mops=:default"
24*0Sstevel@tonic-gate	eval 1;
25*0Sstevel@tonic-gateEOP
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gateprint $@ =~ /trapped/ ? "ok 2\n" : "not ok 2\n# $@\n";
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gate1;
30