From 42422e8e6c4b856e9b81c82e74c70e830177748b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 7 Jan 2014 13:39:10 +0100 Subject: Add function "lastModified" to the "File" JS extension. Change-Id: I96157cfc5404f53a9f48540952462f1b81f2c4e8 Reviewed-by: Joerg Bornemann --- tests/auto/blackbox/testdata/jsextensions/file.qbs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/blackbox') diff --git a/tests/auto/blackbox/testdata/jsextensions/file.qbs b/tests/auto/blackbox/testdata/jsextensions/file.qbs index 123665f60..f6b8ebf79 100644 --- a/tests/auto/blackbox/testdata/jsextensions/file.qbs +++ b/tests/auto/blackbox/testdata/jsextensions/file.qbs @@ -7,6 +7,10 @@ Product { var original = new TextFile("original.txt", TextFile.WriteOnly); original.close(); File.copy("original.txt", "copy.txt"); + var origTimestamp = File.lastModified("original.txt"); + var copyTimestamp = File.lastModified("copy.txt"); + if (origTimestamp > copyTimestamp) + throw new Error("Older file has newer timestamp."); File.remove("original.txt"); var copy = new TextFile("copy.txt", TextFile.WriteOnly); copy.writeLine(File.exists("original.txt")); -- cgit v1.2.1