Use default render to check are all errors mentioned in tests. It's far more easier to read.

This commit is contained in:
Nikolay Krasko
2015-10-26 18:34:07 +03:00
parent b8c72ec4e9
commit 911432c99c
65 changed files with 109 additions and 75 deletions
@@ -22,6 +22,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.ShutDownTracker;
@@ -481,6 +482,13 @@ public class JetTestUtils {
LazyResolveTestUtil.resolve(environment.getProject(), jetFiles, environment);
}
public static void assertEqualsToFile(@NotNull File expectedFile, @NotNull Editor editor) {
String actualText = editor.getDocument().getText();
String afterText = new StringBuilder(actualText).insert(editor.getCaretModel().getOffset(), "<caret>").toString();
assertEqualsToFile(expectedFile, afterText);
}
public static void assertEqualsToFile(@NotNull File expectedFile, @NotNull String actual) {
assertEqualsToFile(expectedFile, actual, new Function1<String, String>() {
@Override