use of com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl in project intellij-community by JetBrains.
the class LocalFileSystemTest method testFileLength.
public void testFileLength() throws Exception {
File file = FileUtil.createTempFile("test", "txt");
FileUtil.writeToFile(file, "hello");
VirtualFile virtualFile = myFS.refreshAndFindFileByIoFile(file);
assertNotNull(virtualFile);
String s = VfsUtilCore.loadText(virtualFile);
assertEquals("hello", s);
assertEquals(5, virtualFile.getLength());
FileUtil.writeToFile(file, "new content");
((PersistentFSImpl) PersistentFS.getInstance()).cleanPersistedContents();
s = VfsUtilCore.loadText(virtualFile);
assertEquals("new content", s);
assertEquals(11, virtualFile.getLength());
}
Aggregations