mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 08:45:34 +07:00
Java surrounders: if and not surrounder should be able to handle java.lang
.Boolean expressions
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
boolean foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
<selection>foo()</selection>
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.lang.Boolean;
|
||||
|
||||
class Test {
|
||||
Boolean foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
<selection>foo()</selection>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import java.lang.Boolean;
|
||||
|
||||
class Test {
|
||||
Boolean foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
if (foo()) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
boolean foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
if (foo()) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.lang.Boolean;
|
||||
|
||||
class Test {
|
||||
Boolean foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
<selection>foo()</selection>
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.lang.Boolean;
|
||||
|
||||
class Test {
|
||||
Boolean foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
!(foo())
|
||||
}
|
||||
}
|
||||
+15
@@ -130,6 +130,21 @@ public class JavaSurroundWithTest extends LightCodeInsightTestCase {
|
||||
TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
|
||||
doTest(getTestName(false), new JavaWithNullCheckSurrounder());
|
||||
}
|
||||
|
||||
public void testSurroundExpressionWithIf() {
|
||||
TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
|
||||
doTest(getTestName(false), new JavaWithIfExpressionSurrounder());
|
||||
}
|
||||
|
||||
public void testSurroundExpressionWithIfForBoxedBooleans() {
|
||||
TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
|
||||
doTest(getTestName(false), new JavaWithIfExpressionSurrounder());
|
||||
}
|
||||
|
||||
public void testSurroundExpressionWithNotForBoxedBooleans() {
|
||||
TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
|
||||
doTest(getTestName(false), new JavaWithNotSurrounder());
|
||||
}
|
||||
|
||||
private void doTest(@NotNull String fileName, final Surrounder surrounder) {
|
||||
configureByFile(BASE_PATH + fileName + ".java");
|
||||
|
||||
Reference in New Issue
Block a user