Merge "Add one more test to ReadTreeTest"

This commit is contained in:
Chris Aniszczyk 2010-08-30 16:59:15 -04:00 committed by Code Review
commit 77f79659f5
1 changed files with 14 additions and 0 deletions

View File

@ -657,6 +657,20 @@ public void testCheckoutUncachedChanges() throws IOException {
assertTrue(new File(trash, "foo").isFile());
}
public void testDontOverwriteDirtyFile() throws IOException {
setupCase(mk("foo"), mk("other"), mk("foo"));
writeTrashFile("foo", "different");
try {
checkout();
fail("Didn't got the expected conflict");
} catch (CheckoutConflictException e) {
assertIndex(mk("foo"));
assertWorkDir(mkmap("foo", "different"));
assertTrue(getConflicts().equals(Arrays.asList("foo")));
assertTrue(new File(trash, "foo").isFile());
}
}
/**
* The interface these tests need from a class implementing a checkout
*/