From: Perl 5 Porters Date: Mon, 30 Sep 1996 04:54:37 +0000 (-0400) Subject: perl 5.003_06: t/lib/symbol.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66deed9817b33ffdba92ebd891ab65a10020d4be;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_06: t/lib/symbol.t Date: Sun, 22 Sep 1996 00:59:56 +0200 From: Gisle Aas Subject: More standard library test scripts This is a collection of test scripts for the standard library modules. Some of the tests does not pass unless some of the patches I have sent out are applied. Date: Mon, 30 Sep 1996 00:54:37 -0400 From: Spider Boardman The various new lib/*.t tests didn't all work. For some, it was only because the count of tests was wrong: --- diff --git a/t/lib/symbol.t b/t/lib/symbol.t new file mode 100644 index 0000000..03449a3 --- /dev/null +++ b/t/lib/symbol.t @@ -0,0 +1,52 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +print "1..8\n"; + +BEGIN { $_ = 'foo'; } # because Symbol used to clobber $_ + +use Symbol; + +# First check $_ clobbering +print "not " if $_ ne 'foo'; +print "ok 1\n"; + + +# First test gensym() +$sym1 = gensym; +print "not " if ref($sym1) ne 'GLOB'; +print "ok 2\n"; + +$sym2 = gensym; + +print "not " if $sym1 eq $sym2; +print "ok 3\n"; + +ungensym $sym1; + +$sym1 = $sym2 = undef; + + +# Test qualify() +package foo; + +use Symbol qw(qualify); # must import into this package too + +qualify("x") eq "foo::x" or print "not "; +print "ok 4\n"; + +qualify("x", "FOO") eq "FOO::x" or print "not "; +print "ok 5\n"; + +qualify("BAR::x") eq "BAR::x" or print "not "; +print "ok 6\n"; + +qualify("STDOUT") eq "main::STDOUT" or print "not "; +print "ok 7\n"; + +qualify("ARGV", "FOO") eq "main::ARGV" or print "not "; +print "ok 8\n";