diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-01-21 09:16:07 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-01-21 09:16:07 +0000 |
commit | ab07f6680c0c15e8dad678f1c7fbe1ad90845467 (patch) | |
tree | 073ce0603db34b37eb07458700956d77a9314ca3 /t/op | |
parent | 3a096bf351e068ac899b4c940544630c7ab75de2 (diff) | |
parent | 69282e910994b718c7eedc8f550888058a4e93ff (diff) | |
download | perl-ab07f6680c0c15e8dad678f1c7fbe1ad90845467.tar.gz |
Integrate with Sarathy.
p4raw-id: //depot/cfgperl@4831
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/exists_sub.t | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/t/op/exists_sub.t b/t/op/exists_sub.t new file mode 100755 index 0000000000..3363dfd837 --- /dev/null +++ b/t/op/exists_sub.t @@ -0,0 +1,46 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; +} + +print "1..9\n"; + +sub t1; +sub t2 : locked; +sub t3 (); +sub t4 ($); +sub t5 {1;} +{ + package P1; + sub tmc {1;} + package P2; + @ISA = 'P1'; +} + +print "not " unless exists &t1 && not defined &t1; +print "ok 1\n"; +print "not " unless exists &t2 && not defined &t2; +print "ok 2\n"; +print "not " unless exists &t3 && not defined &t3; +print "ok 3\n"; +print "not " unless exists &t4 && not defined &t4; +print "ok 4\n"; +print "not " unless exists &t5 && defined &t5; +print "ok 5\n"; +P2::->tmc; +print "not " unless not exists &P2::tmc && not defined &P2::tmc; +print "ok 6\n"; +my $ref; +$ref->{A}[0] = \&t4; +print "not " unless exists &{$ref->{A}[0]} && not defined &{$ref->{A}[0]}; +print "ok 7\n"; +undef &P1::tmc; +print "not " unless exists &P1::tmc && not defined &P1::tmc; +print "ok 8\n"; +eval 'exists &t5()'; +print "not " unless $@; +print "ok 9\n"; + +exit 0; |