This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Simplify lib/File/stat.t by using a tempfile as the test victim.
authorNicholas Clark <nick@ccl4.org>
Sun, 3 Jun 2012 11:26:31 +0000 (13:26 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 21 Jun 2012 06:59:00 +0000 (08:59 +0200)
commit17c017a51cc9557d7d50c5113b67db8442762c56
treef662058cafbe5fe2cf14ca7a798e27412bb06b2c
parent2ca571f439610d1ce38c8fbcb4bb638b2d881be1
Simplify lib/File/stat.t by using a tempfile as the test victim.

The previous code had got very gnarly trying to use a file from the
distribution for the test file, attempting to cope with
1) Other programs reading the file and hence the atime updating
2) The perl interpreter reading the file and hence the atime updating :-)
3) Building with -Dmksymlinks meaning that the file is a symlink

All these problems and work arounds simply *vanish* if we use a tempfile.
This will also enable us to change its mode in the future for better testing.
lib/File/stat.t