cover with tests

This commit is contained in:
Andrey Starovoyt
2014-05-27 16:47:17 +04:00
parent ce036b544a
commit 8e0bbd5967
16 changed files with 134 additions and 5 deletions
@@ -0,0 +1,7 @@
public class Foo {
void m(boolean b) {
b.assert<caret>
value = null;
}
}
@@ -0,0 +1,7 @@
public class Foo {
void m(boolean b) {
assert b;<caret>
value = null;
}
}
@@ -0,0 +1,9 @@
public class Foo {
void m() {
is();.assert<caret>
}
boolean is() {
return false;
}
}
@@ -0,0 +1,9 @@
public class Foo {
void m() {
assert is();<caret>
}
boolean is() {
return false;
}
}
@@ -0,0 +1,7 @@
public class Foo {
void m(boolean b) {
b.if<caret>
value = null;
}
}
@@ -0,0 +1,9 @@
public class Foo {
void m(boolean b) {
if (b) {
<caret>
}
value = null;
}
}
@@ -0,0 +1,9 @@
public class Foo {
void m() {
is();.if<caret>
}
boolean is() {
return false;
}
}
@@ -0,0 +1,11 @@
public class Foo {
void m() {
if (is()) {
<caret>
}
}
boolean is() {
return false;
}
}
@@ -0,0 +1,9 @@
import java.lang.Exception;
public class Foo {
void m(Exception e) {
e.throw<caret>
value = null
}
}
@@ -0,0 +1,9 @@
import java.lang.Exception;
public class Foo {
void m(Exception e) {
throw e;<caret>
value = null
}
}
@@ -1,5 +1,5 @@
public class Foo {
void m(Object o) {
throw o;<caret>
o.throw <caret>
}
}
@@ -0,0 +1,7 @@
import java.lang.RuntimeException;
public class Foo {
void m() {
new RuntimeException("error");.throw<caret>
}
}
@@ -0,0 +1,7 @@
import java.lang.RuntimeException;
public class Foo {
void m() {
throw new RuntimeException("error");
}
}
@@ -63,5 +63,13 @@ public class AssertStatementPostfixTemplateTest extends PostfixTemplateTestCase
public void testNotNull() {
doTest();
}
public void testBeforeAssignment() {
doTest();
}
public void testSimpleWithSemicolon() {
doTest();
}
}
@@ -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();
}
}
@@ -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();
}
}