This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Opening dirhandle DIR also as a file needs no warnings 'deprecated';
authorNicholas Clark <nick@ccl4.org>
Tue, 13 Oct 2009 14:35:15 +0000 (15:35 +0100)
committerJesse Vincent <jesse@bestpractical.com>
Fri, 16 Oct 2009 16:30:16 +0000 (12:30 -0400)
t/op/stat.t

index 007869e..5167655 100644 (file)
@@ -495,8 +495,11 @@ SKIP: {
     ok(-d DIR, "-d on a dirhandle works");
 
     # And now for the ambigious bareword case
-    ok(open(DIR, "TEST"), 'Can open "TEST" dir')
-       || diag "Can't open 'TEST':  $!";
+    {
+       no warnings 'deprecated';
+       ok(open(DIR, "TEST"), 'Can open "TEST" dir')
+           || diag "Can't open 'TEST':  $!";
+    }
     my $size = (stat(DIR))[7];
     ok(defined $size, "stat() on bareword works");
     is($size, -s "TEST", "size returned by stat of bareword is for the file");
@@ -525,8 +528,11 @@ SKIP: {
         ok(-d -r *DIR{IO} , "chained -x's on *DIR{IO}");
 
        # And now for the ambigious bareword case
-       ok(open(DIR, "TEST"), 'Can open "TEST" dir')
-           || diag "Can't open 'TEST':  $!";
+       {
+           no warnings 'deprecated';
+           ok(open(DIR, "TEST"), 'Can open "TEST" dir')
+               || diag "Can't open 'TEST':  $!";
+       }
        my $size = (stat(*DIR{IO}))[7];
        ok(defined $size, "stat() on *THINGY{IO} works");
        is($size, -s "TEST",