gv.t revision 1
1N/A# various typeglob tests 1N/A chdir 't' if -d 't'; 1N/A# type coersion on assignment 1N/A# type coersion (not) on misc ops 1N/A# type coersion on substitutions that match 1N/Aprint ref(\$a) eq 'GLOB' ?
"ok 5\n" :
"not ok 5\n";
1N/Aprint $a
eq 'main::foo' ?
"ok 6\n" :
"not ok 6\n";
1N/Aprint ref(\$b) eq 'GLOB' ?
"ok 7\n" :
"not ok 7\n";
1N/A# typeglobs as lvalues 1N/Aprint $foo eq 'XXXmain::bar' ?
"ok 9\n" :
"not ok 9\n";
1N/A# returning glob values 1N/A print ref(\$fuu) eq 'GLOB' ? "ok 10\n" : "not ok 10\n"; 1N/A print ref(\$baa) eq 'GLOB' ? "ok 11\n" : "not ok 11\n"; 1N/A# nested package globs 1N/A# NOTE: It's probably OK if these semantics change, because the 1N/A# fact that %X::Y:: is stored in %X:: isn't documented. 1N/Aprint $Foo::{
'Bar::'}
eq '*Foo::Bar::' ?
"ok 13\n" :
"not ok 13\n";
1N/A# test undef operator clearing out entire glob 1N/A# test warnings from assignment of undef to glob 1N/A print $msg ? "not ok" : "ok", " 15\n"; 1N/A print $msg ? "ok" : "not ok", " 16\n"; 1N/A# test *glob{THING} syntax 1N/A%x = ("ok 19" => "\n"); 1N/Aprint *{*x{GLOB}} eq "*main::STDOUT" ? "ok 22\n" : "not ok 22\n"; 1N/A# test if defined() doesn't create any new symbols 1N/A# although it *should* if you're talking about magicals 1N/A print "not " if ${$a}; 1N/A "o" =~ /(((((((((((o)))))))))))/; 1N/A# [ID 20010526.001] localized glob loses value when assigned to 1N/A$j=1; %j=(a=>1); @j=(1); local *j=*j; *j = sub{}; 1N/Aprint $j == 1 ? "ok 41\n" : "not ok 41\n"; 1N/Aprint $j{a} == 1 ? "ok 42\n" : "not ok 42\n"; 1N/Aprint $j[0] == 1 ? "ok 43\n" : "not ok 43\n"; 1N/A# does pp_readline() handle glob-ness correctly? 1N/A print $w eq '' ? "ok 45\n" : "not ok 45\n# $w"; 1N/A print $w eq '' ? "ok 46\n" : "not ok 46\n# $w"; 1N/A # [17375] rcatline to formerly-defined undef was broken. Fixed in 1N/A # do_readline by checking SvOK. AMS, 20020918