FileSnapshotTest: Add more MISSING_FILE coverage
Add a couple tests that confirm what the docs say about isModified() and equals(MISSING_FILE) behavior. Change-Id: I6093040ba3594934c3270331405a44b2634b97c5 Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
This commit is contained in:
parent
aa9f736c33
commit
2011fe06d2
|
@ -209,6 +209,20 @@ public void fileSnapshotEquals() throws Exception {
|
||||||
assertTrue(fs2.equals(fs1));
|
assertTrue(fs2.equals(fs1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void snapshotAndFileMissingIsNotModified() throws Exception {
|
||||||
|
File doesNotExist = trash.resolve("DOES_NOT_EXIST").toFile();
|
||||||
|
FileSnapshot missing = FileSnapshot.save(doesNotExist);
|
||||||
|
assertFalse(missing.isModified(doesNotExist));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void missingFileEquals() throws Exception {
|
||||||
|
FileSnapshot missing = FileSnapshot.save(
|
||||||
|
trash.resolve("DOES_NOT_EXIST").toFile());
|
||||||
|
assertTrue(missing.equals(FileSnapshot.MISSING_FILE));
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("boxing")
|
@SuppressWarnings("boxing")
|
||||||
@Test
|
@Test
|
||||||
public void detectFileModified() throws IOException {
|
public void detectFileModified() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue