This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
to-do tests for #113932 (UNIVERSAL::can and handles)
authorFather Chrysostomos <sprout@cpan.org>
Sun, 7 Jul 2013 05:32:53 +0000 (22:32 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 7 Jul 2013 05:32:53 +0000 (22:32 -0700)
t/op/universal.t

index 9db10c8..4edbed3 100644 (file)
@@ -10,7 +10,7 @@ BEGIN {
     require "./test.pl";
 }
 
-plan tests => 139;
+plan tests => 142;
 
 $a = {};
 bless $a, "Bob";
@@ -111,6 +111,14 @@ ok UNIVERSAL::can(23, "can");
 ++${"23::foo"};
 ok UNIVERSAL::can("23", "can"), '"23" can can when the pack exists';
 ok UNIVERSAL::can(23, "can"), '23 can can when the pack exists';
+{
+    local $::TODO = '[perl #113932]';
+    ok UNIVERSAL::can(*STDOUT, 'print'), 'globs with IOs can can';
+    ok UNIVERSAL::can(\*STDOUT, 'print'), 'globrefs with IOs can can';
+    sub IO::Handle::turn {}
+    # Should this pass?  Or is the existing behaviour correct?
+    ok UNIVERSAL::can("STDOUT", 'turn'), 'IO barewords can';
+}
 
 ok $a->can("VERSION");