diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2002-02-25 07:04:57 -0800 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-26 01:01:13 +0000 |
commit | ae716a98930f0a80b96ee5d383780578d69d0830 (patch) | |
tree | c182c19694d8914c09ea20973f4634046ed4eec0 /lib/Symbol.t | |
parent | e48df184541995015048bca83e39a89859aa31ce (diff) | |
download | perl-ae716a98930f0a80b96ee5d383780578d69d0830.tar.gz |
Perl interface to newIO()
Message-ID: <ZMse8gzkg6oQ092yn@efn.org>
p4raw-id: //depot/perl@14878
Diffstat (limited to 'lib/Symbol.t')
-rwxr-xr-x | lib/Symbol.t | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/Symbol.t b/lib/Symbol.t index 3bac9033fd..5763e5420e 100755 --- a/lib/Symbol.t +++ b/lib/Symbol.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -use Test::More tests => 10; +use Test::More tests => 14; BEGIN { $_ = 'foo'; } # because Symbol used to clobber $_ @@ -26,6 +26,27 @@ ungensym $sym1; $sym1 = $sym2 = undef; +# Test geniosym() + +use Symbol qw(geniosym); + +$sym1 = geniosym; +like( $sym1, qr/=IO\(/, 'got an IO ref' ); + +$FOO = 'Eymascalar'; +*FOO = $sym1; + +is( $sym1, *FOO{IO}, 'assigns into glob OK' ); + +is( $FOO, 'Eymascalar', 'leaves scalar alone' ); + +{ + local $^W=1; # 5.005 compat. + my $warn; + local $SIG{__WARN__} = sub { $warn .= "@_" }; + readline FOO; + like( $warn, qr/unopened filehandle/, 'warns like an unopened filehandle' ); +} # Test qualify() package foo; |