Subject: | [PATCH] Sync utime.t with bleadperl |
The attached patch syncs the utime.t test script with a minor change in bleadperl to stop Git from flagging the touch_me file as having been changed after the test has run.
Please could you incorporate this change into a future CPAN release? It isn't urgent but if you were able to do this before 20th September when the next release of bleadperl is due I would be very grateful. (I note that you've also spotted another patch to a test script in #88076. The two patches between them get things fully in sync with bleadperl.)
Subject: | touch_me.patch |
diff -ruN autodie-2.20.orig/t/utime.t autodie-2.20/t/utime.t
--- autodie-2.20.orig/t/utime.t 2013-06-24 00:08:50.000000000 +0100
+++ autodie-2.20/t/utime.t 2013-09-05 17:58:37.703234200 +0100
@@ -10,9 +10,15 @@
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);