From c7bc11f26fc4aa8e2a9c7e1bec60076944181b52 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 19 Mar 2012 09:49:31 +0000 Subject: Use utime to make initial files in trail test come from the past This ensures that when we do the second phase of the test (edit some files and refresh), the changes get a different mtime and are picked up, even if the entire test happened between two 1-second "clock ticks". --- t/trail.t | 73 ++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 31 deletions(-) (limited to 't/trail.t') diff --git a/t/trail.t b/t/trail.t index 17fe54310..b24a81e41 100755 --- a/t/trail.t +++ b/t/trail.t @@ -9,9 +9,19 @@ my $blob; ok(! system("rm -rf t/tmp")); ok(! system("mkdir t/tmp")); +# Write files with a date in the past, so that when we refresh, +# the update is detected. +sub write_old_file { + my $name = shift; + my $content = shift; + + writefile($name, "t/tmp/in", $content); + ok(utime(333333333, 333333333, "t/tmp/in/$name")); +} + # Use a rather stylized template to override the default rendering, to make # it easy to search for the desired results -writefile("templates/trails.tmpl", "t/tmp/in", <