diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-06-02 22:42:47 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-06-21 08:58:59 +0200 |
commit | c239c67cfc765f17d1895e3d41e705fb1e75af04 (patch) | |
tree | 17818cdb892481f22ea0008c3b793367b7f8f005 /lib/File | |
parent | 15fd090fd79e9509cbc7d1ac9791ea71edd52d03 (diff) | |
download | perl-c239c67cfc765f17d1895e3d41e705fb1e75af04.tar.gz |
Convert lib/File/stat.t from a complex plan calculation to done_testing().
Also replace use_ok (not in BEGIN) with a simple require. If the require
fails it's not worth trying to test anything else, Test::More's END
handing will automatically report a test failure, so the failure will be
recorded.
Add an editor block.
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/stat.t | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/File/stat.t b/lib/File/stat.t index 78d57d8c30..7433de82ec 100644 --- a/lib/File/stat.t +++ b/lib/File/stat.t @@ -42,12 +42,10 @@ BEGIN { our @stat = stat $file; # This is the function stat. unless (@stat) { plan skip_all => "1..0 # Skip: no file $file"; exit 0 } -plan tests => 19 + 24*2 + 4 + 3 + 7 + 2; - -use_ok( 'File::stat' ); +require File::stat; my $stat = File::stat::stat( $file ); # This is the OO stat. -ok( ref($stat), 'should build a stat object' ); +isa_ok($stat, 'File::stat', 'should build a stat object' ); is( $stat->dev, $stat[0], "device number in position 0" ); @@ -137,7 +135,6 @@ SKIP: { } { # 111640 - File::stat bogus index check in overload - # 7 tests in this block use filetest "access"; use warnings; @@ -177,3 +174,12 @@ $stat = stat '/notafile'; isnt( $!, '', 'should populate $!, given invalid file' ); # Testing pretty much anything else is unportable. + +done_testing; + +# Local variables: +# cperl-indent-level: 4 +# indent-tabs-mode: nil +# End: +# +# ex: set ts=8 sts=4 sw=4 et: |