From d853b8ee6f3cd1798e9477b7e82dbd040fd3fd21 Mon Sep 17 00:00:00 2001 From: Alban Auzeill Date: Mon, 26 Oct 2020 19:22:32 +0100 Subject: [PATCH] Fix same date on several file changes --- src/test/java/com/auzeill/file/StatsTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/auzeill/file/StatsTest.java b/src/test/java/com/auzeill/file/StatsTest.java index 9d251c8..b93c672 100644 --- a/src/test/java/com/auzeill/file/StatsTest.java +++ b/src/test/java/com/auzeill/file/StatsTest.java @@ -137,7 +137,7 @@ void reuse_sha1_from_previous_save(@TempDir Path tempDir) throws IOException { } @Test - void diff_from_previous(@TempDir Path tempDir) throws IOException { + void diff_from_previous(@TempDir Path tempDir) throws IOException, InterruptedException { Files.writeString(tempDir.resolve("f1"), "abcd", UTF_8); Files.writeString(tempDir.resolve("f2"), "efgh", UTF_8); Files.writeString(tempDir.resolve("f3"), "ijdk", UTF_8); @@ -157,6 +157,8 @@ void diff_from_previous(@TempDir Path tempDir) throws IOException { "f5|f|4|alban|alban|rw-r--r--|2020-09-02T15:43:48.680382Z|2aed8aa9f826c21ef07d5ee15b48eea06e9c8a62" + System.lineSeparator() + ".|d|16|alban|alban|rwx------|2020-09-02T15:43:48.680382Z|f81b3e16656c1bd84d7522ed2f83fa996ffd8497" + System.lineSeparator()); + // ensure the following modified file date will be different + Thread.sleep(10); Files.delete(tempDir.resolve("f2")); Files.writeString(tempDir.resolve("f3"), "changed content", UTF_8);