This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor lib/File/stat.t for robustness.
authorNicholas Clark <nick@ccl4.org>
Wed, 13 Jun 2012 15:34:11 +0000 (17:34 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 21 Jun 2012 07:00:36 +0000 (09:00 +0200)
commitcf23dc19b46f3d95146b1e58fd518288359d7a48
tree04da180adad66be40b92de677e731c3384765de9
parent92508f95d17cda6a6995cd4650e72c3ac1187c37
Refactor lib/File/stat.t for robustness.

Use CORE::stat instead of stat, to be clear which is the builtin, and which
is the routine that File::stat is prepared to export. As it is now
unambiguous which is which, remove comments that annotated each use.

Use isa_ok() in place of ok() to test the return value of File::stat::stat.
Use is_deeply() in place of is() and arrays interpolated into strings.

Move the data driven loop that tests most of the -X operators into a
function test_X_ops(), and use this to test both the tempfile
(non-executable) and $^X (executable).

Put the first sanity test of File::stat::stat inside a block so that its
lexicals don't leak.
lib/File/stat.t