summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
index 5ebdeb6e8f..6e458fbbf0 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
@@ -180,6 +180,17 @@ public class FileSnapshotTest {
assertTrue(save.wasSizeChanged());
}
+ @Test
+ public void fileSnapshotEquals() throws Exception {
+ // 0 sized FileSnapshot.
+ FileSnapshot fs1 = FileSnapshot.MISSING_FILE;
+ // UNKNOWN_SIZE FileSnapshot.
+ FileSnapshot fs2 = FileSnapshot.save(fs1.lastModified());
+
+ assertTrue(fs1.equals(fs2));
+ assertTrue(fs2.equals(fs1));
+ }
+
private File createFile(String string) throws IOException {
trash.mkdirs();
File f = File.createTempFile(string, "tdat", trash);