Skip to content

Commit

Permalink
Fix same date on several file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alban-auzeill committed Oct 26, 2020
1 parent eb9b95f commit d853b8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/test/java/com/auzeill/file/StatsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit d853b8e

Please sign in to comment.