Stubs tests: treat NO_NAME_FOR_LAZY_RESOLVE specially
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
PsiJetFileStubImpl[package=]
|
||||
OBJECT_DECLARATION:PsiJetObjectStubImpl[top name=null fqName=null superNames=[]]
|
||||
OBJECT_DECLARATION:PsiJetObjectStubImpl[top name=null fqName=<no name> superNames=[]]
|
||||
CLASS_BODY:PsiJetClassBodyStubImpl
|
||||
FUN:PsiJetFunctionStubImpl[name=testing]
|
||||
VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl
|
||||
|
||||
@@ -24,15 +24,18 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetFileStubBuilder;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils.NO_NAME_FOR_LAZY_RESOLVE;
|
||||
|
||||
public abstract class AbstractStubBuilderTest extends LightCodeInsightFixtureTestCase {
|
||||
protected void doTest(@NotNull String sourcePath) {
|
||||
JetFile file = (JetFile) myFixture.configureByFile(sourcePath);
|
||||
JetFileStubBuilder jetStubBuilder = new JetFileStubBuilder();
|
||||
StubElement lighterTree = jetStubBuilder.buildStubTree(file);
|
||||
String stubTree = DebugUtil.stubTreeToString(lighterTree);
|
||||
String stubTree = DebugUtil.stubTreeToString(lighterTree).replace(NO_NAME_FOR_LAZY_RESOLVE.asString(), "<no name>");
|
||||
String expectedFile = sourcePath.replace(".kt", ".expected");
|
||||
JetTestUtils.assertEqualsToFile(new File(expectedFile), stubTree);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user