summaryrefslogtreecommitdiff
path: root/lib/File/stat.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-06-13 18:01:48 +0200
committerNicholas Clark <nick@ccl4.org>2012-06-21 09:00:36 +0200
commitff4803d9cfd18b5f2c1c00c307ca73700c048174 (patch)
tree175630f8080f8e0d56b83e8d2df5ad4b4530a64e /lib/File/stat.t
parent81a201f4537a4e258fe8dcbd6f117773b55b3b91 (diff)
downloadperl-ff4803d9cfd18b5f2c1c00c307ca73700c048174.tar.gz
Test that File::stat exports stat by default, overriding the builtin.
Also, add a test that the array produced by File::stat::stat is identical to the list produced by the builtin.
Diffstat (limited to 'lib/File/stat.t')
-rw-r--r--lib/File/stat.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/File/stat.t b/lib/File/stat.t
index 5a66b46867..641cfadef3 100644
--- a/lib/File/stat.t
+++ b/lib/File/stat.t
@@ -11,7 +11,7 @@ use Test::More;
use Config qw( %Config );
use File::Temp qw( tempfile tempdir );
-require File::stat;
+use File::stat;
my (undef, $file) = tempfile();
@@ -19,6 +19,7 @@ my (undef, $file) = tempfile();
my @stat = CORE::stat $file;
my $stat = File::stat::stat($file);
isa_ok($stat, 'File::stat', 'should build a stat object');
+ is_deeply($stat, \@stat, '... and matches the builtin');
my $i = 0;
foreach ([dev => 'device number'],
@@ -43,6 +44,11 @@ my (undef, $file) = tempfile();
}
++$i;
}
+
+ my $stat2 = stat $file;
+ isa_ok($stat2, 'File::stat',
+ 'File::stat exports stat, overriding the builtin');
+ is_deeply($stat2, $stat, '... and matches the direct call');
}
sub test_X_ops {