From e9375974cb0898ddd12e8dfd2090905f58c3c6d2 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Sun, 22 Jun 2014 23:11:35 +0200 Subject: [PATCH] rollback.t: Get rid of stat Using stat to get the last edit timestamp can lead to a failing test. To be absolutely certain, use the timestamp stored in the page file. As it stands, $Now is used for the timestamp in the page file but if this is a new file (revision 1), then the index file gets rewritten and its timestamp changes. --- t/rollback.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/rollback.t b/t/rollback.t index 76c1af52..aaa55303 100755 --- a/t/rollback.t +++ b/t/rollback.t @@ -154,7 +154,8 @@ test_page_negative($page, # test url encoding test_page(update_page('Schröder', 'Alex', 'eins'), 'Alex'); -$to = (stat($IndexFile))[9]; +OpenPage('Schröder'); +$to = $Page{ts}; sleep(1); test_page(update_page('HiddenEdit', 'not to be rolled back', 'secret'), 'not to be rolled back'); test_page(update_page('Schröder', 'Berta', 'zwei'), 'Berta');