mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cover with tests
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
public class Foo {
|
||||
void m(boolean b) {
|
||||
|
||||
b.assert<caret>
|
||||
value = null;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class Foo {
|
||||
void m(boolean b) {
|
||||
|
||||
assert b;<caret>
|
||||
value = null;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public class Foo {
|
||||
void m() {
|
||||
is();.assert<caret>
|
||||
}
|
||||
|
||||
boolean is() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public class Foo {
|
||||
void m() {
|
||||
assert is();<caret>
|
||||
}
|
||||
|
||||
boolean is() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class Foo {
|
||||
void m(boolean b) {
|
||||
|
||||
b.if<caret>
|
||||
value = null;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public class Foo {
|
||||
void m(boolean b) {
|
||||
|
||||
if (b) {
|
||||
<caret>
|
||||
}
|
||||
value = null;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public class Foo {
|
||||
void m() {
|
||||
is();.if<caret>
|
||||
}
|
||||
|
||||
boolean is() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
public class Foo {
|
||||
void m() {
|
||||
if (is()) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
boolean is() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Foo {
|
||||
void m(Exception e) {
|
||||
|
||||
e.throw<caret>
|
||||
value = null
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import java.lang.Exception;
|
||||
|
||||
public class Foo {
|
||||
void m(Exception e) {
|
||||
|
||||
throw e;<caret>
|
||||
value = null
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
public class Foo {
|
||||
void m(Object o) {
|
||||
throw o;<caret>
|
||||
o.throw <caret>
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import java.lang.RuntimeException;
|
||||
|
||||
public class Foo {
|
||||
void m() {
|
||||
new RuntimeException("error");.throw<caret>
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import java.lang.RuntimeException;
|
||||
|
||||
public class Foo {
|
||||
void m() {
|
||||
throw new RuntimeException("error");
|
||||
}
|
||||
}
|
||||
+8
@@ -63,5 +63,13 @@ public class AssertStatementPostfixTemplateTest extends PostfixTemplateTestCase
|
||||
public void testNotNull() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testBeforeAssignment() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSimpleWithSemicolon() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-4
@@ -18,6 +18,13 @@ package com.intellij.codeInsight.template.postfix.templates;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class IfStatementPostfixTemplateTest extends PostfixTemplateTestCase {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getSuffix() {
|
||||
return "if";
|
||||
}
|
||||
|
||||
public void testBooleanVariableBeforeAssignment() {
|
||||
doTest();
|
||||
}
|
||||
@@ -54,9 +61,13 @@ public class IfStatementPostfixTemplateTest extends PostfixTemplateTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getSuffix() {
|
||||
return "if";
|
||||
public void testSimpleWithSemicolon() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testBeforeAssignment() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+10
@@ -27,4 +27,14 @@ public class ThrowStatementPostfixTemplateTest extends PostfixTemplateTestCase {
|
||||
public void testSimple() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNotThrowable() {
|
||||
doTest();
|
||||
}
|
||||
public void testBeforeAssignment() {
|
||||
doTest();
|
||||
}
|
||||
public void testSimpleWithSemicolon() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user