diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2013-09-05 18:11:07 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2013-09-05 18:11:07 +0100 |
commit | a1a6b6b3044782a2079b680cd42f12ae08fc53e2 (patch) | |
tree | 712442153d2e388942a4ed0029a5870321f258c7 /cpan/autodie | |
parent | b228daaaa1e2cef4915a992e989cc386726d10a5 (diff) | |
download | perl-a1a6b6b3044782a2079b680cd42f12ae08fc53e2.tar.gz |
Stop autodie test from changing a file to stop Git whining about uncommitted changes
The patch has been sent upstream as CPAN#88444.
Diffstat (limited to 'cpan/autodie')
-rw-r--r-- | cpan/autodie/t/utime.t | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cpan/autodie/t/utime.t b/cpan/autodie/t/utime.t index 983ca9c667..d52764a260 100644 --- a/cpan/autodie/t/utime.t +++ b/cpan/autodie/t/utime.t @@ -10,9 +10,15 @@ use autodie; eval { utime(undef, undef, NO_SUCH_FILE); }; isa_ok($@, 'autodie::exception', 'exception thrown for utime'); +my($atime, $mtime) = (stat TOUCH_ME)[8, 9]; + eval { utime(undef, undef, TOUCH_ME); }; ok(! $@, "We can utime a file just fine.") or diag $@; eval { utime(undef, undef, NO_SUCH_FILE, TOUCH_ME); }; isa_ok($@, 'autodie::exception', 'utime exception on single failure.'); is($@->return, 1, "utime fails correctly on a 'true' failure."); + +# Reset timestamps so that Git doesn't think the file has changed when +# running the test in the core perl distribution. +utime($atime, $mtime, TOUCH_ME); |