public void assertCompletionResultEquals(@NotNull FileType fileType, @NotNull String contents, @NotNull String result, @NotNull LookupElementInsert.Assert assertion) { myFixture.configureByText(fileType, contents); UIUtil.invokeAndWaitIfNeeded(new MyLookupElementConditionalInsertRunnable(assertion)); myFixture.checkResult(result); }
public void assertCompletionResultEquals(String filename, String complete, String result) { myFixture.configureByText(filename, complete); myFixture.completeBasic(); myFixture.checkResult(result); }
public void assertCompletionResultEquals(LanguageFileType languageFileType, String complete, String result) { myFixture.configureByText(languageFileType, complete); myFixture.completeBasic(); myFixture.checkResult(result); }
protected void doTestBackspaceWithoutFiles(@NotNull String initialText, @NotNull String expected) { initWithTextSmart(initialText); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_BACKSPACE); myFixture.checkResult(expected); }
public void testCloseParentheses() throws Exception { myFixture.configureByText("test.cyp", "MATCH <caret>"); myFixture.type("("); myFixture.checkResult("MATCH (<caret>)"); }
protected void testSmartKey(String original, char typed, String expected) { initWithTextSmart(original); myFixture.type(typed); myFixture.checkResult(expected); }
public void testUsage() { myFixture.configureByText(MathematicaFileType.INSTANCE, "func::usage = \"func<caret> is a function called like func[]\";"); myFixture.renameElementAtCaret("newFunc"); myFixture.checkResult("newFunc::usage = \"newFunc is a function called like newFunc[]\";"); }
public void testDollarVariables() { myFixture.configureByText(MathematicaFileType.INSTANCE, "var$ = 1;\n" + "var$<caret> + var$"); myFixture.renameElementAtCaret("$var$"); myFixture.checkResult("$var$ = 1;\n" + "$var$ + $var$"); }
public void testNormalVariable() { myFixture.configureByText(MathematicaFileType.INSTANCE, "var1;\n" + "var1::usage = \"var1 is equal to nothing..\";\n" + "var1<caret>=1;"); myFixture.renameElementAtCaret("var2"); myFixture.checkResult("var2;\n" + "var2::usage = \"var2 is equal to nothing..\";\n" + "var2=1;"); }
public void testPresentInCompletion() throws Exception { myFixture.configureByText("test.cyp", "MATCH (n:TestLabel) RETURN n; MATCH (n:Test<caret>"); myFixture.completeBasic(); myFixture.checkResult("MATCH (n:TestLabel) RETURN n; MATCH (n:TestLabel<caret>"); }
public void testPresentInCompletion() throws Exception { myFixture.configureByText("test.cyp", "MATCH ()-[:TESTRELTYPE]-() MATCH ()-[:TESTREL<caret>"); myFixture.completeBasic(); myFixture.checkResult("MATCH ()-[:TESTRELTYPE]-() MATCH ()-[:TESTRELTYPE<caret>"); }
public void testCompletionCaretInsideParentheses() throws Exception { myFixture.configureByText("test.cyp", "RETURN toStrin<caret>"); myFixture.completeBasic(); myFixture.checkResult("RETURN toString(<caret>)"); }
public void assertCompletionResultEquals(LanguageFileType languageFileType, String complete, String result) { myFixture.configureByText(languageFileType, complete); myFixture.completeBasic(); myFixture.checkResult(result); }
public void testCloseSquare() throws Exception { myFixture.configureByText("test.cyp", "RETURN <caret>"); myFixture.type("["); myFixture.checkResult("RETURN [<caret>]"); }
public void testPresentInCompletion() throws Exception { myFixture.configureByText("test.cyp", "MATCH (n) WHERE n.testProperty = 1 RETURN n.testProp<caret>"); myFixture.completeBasic(); myFixture.checkResult("MATCH (n) WHERE n.testProperty = 1 RETURN n.testProperty<caret>"); }
public void _testOneEntryPresentInCompletionIfMetadataExists() throws Exception { addRelationshipType("TESTRELTYPE"); myFixture.configureByText("test.cyp", "MATCH ()-[:TESTRELTYPE]-() MATCH ()-[:TESTREL<caret>"); myFixture.completeBasic(); myFixture.checkResult("MATCH ()-[:TESTRELTYPE]-() MATCH ()-[:TESTRELTYPE<caret>"); } }
public void _testOneEntryPresentInCompletionIfMetadataExists() throws Exception { addProperty("testProperty"); myFixture.configureByText("test.cyp", "MATCH (n) WHERE n.testProperty = 1 RETURN n.testProp<caret>"); myFixture.completeBasic(); myFixture.checkResult("MATCH (n) WHERE n.testProperty = 1 RETURN n.testProperty<caret>"); } }
public void testCompletionLookupChar() throws Exception { myFixture.configureByText("test.cyp", "RETURN s<caret>"); myFixture.completeBasic(); myFixture.finishLookup(Lookup.REPLACE_SELECT_CHAR); myFixture.checkResult("RETURN shortestPath(<caret>)"); } }
public void _testOneEntryPresentInCompletionIfMetadataExists() throws Exception { addLabel("TestLabel"); myFixture.configureByText("test.cyp", "MATCH (n:TestLabel) RETURN n; MATCH (n:Test<caret>"); myFixture.completeBasic(); myFixture.checkResult("MATCH (n:TestLabel) RETURN n; MATCH (n:TestLabel<caret>"); } }
protected void doTest(String actual, String expected) { PsiFile file = myFixture.addFileToProject("test.cypher", actual); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); WriteCommandAction.runWriteCommandAction(getProject(), () -> { PsiFile f = myFixture.getFile(); CodeStyleManager.getInstance(getProject()) .reformatText(f, singletonList(f.getTextRange())); }); myFixture.checkResult(expected); } }