tests fixed
This commit is contained in:
@@ -142,7 +142,7 @@ public interface Errors {
|
||||
};
|
||||
PsiElementOnlyDiagnosticFactory3<JetModifierListOwner, CallableMemberDescriptor, CallableMemberDescriptor, DeclarationDescriptor> VIRTUAL_MEMBER_HIDDEN = PsiElementOnlyDiagnosticFactory3.create(ERROR, "''{0}'' hides ''{1}'' in class {2} and needs 'override' modifier", DescriptorRenderer.TEXT);
|
||||
|
||||
PsiElementOnlyDiagnosticFactory1<JetSimpleNameExpression, DeclarationDescriptor> UNINITIALIZED_VARIABLE = PsiElementOnlyDiagnosticFactory1.create(ERROR, "Variable ''{0}'' must be uninitialized", NAME);
|
||||
PsiElementOnlyDiagnosticFactory1<JetSimpleNameExpression, DeclarationDescriptor> UNINITIALIZED_VARIABLE = PsiElementOnlyDiagnosticFactory1.create(ERROR, "Variable ''{0}'' must be initialized", NAME);
|
||||
PsiElementOnlyDiagnosticFactory1<JetSimpleNameExpression, DeclarationDescriptor> VAL_REASSIGNMENT = PsiElementOnlyDiagnosticFactory1.create(ERROR, "Val can not be reassigned", NAME);
|
||||
|
||||
SimpleDiagnosticFactory UNREACHABLE_CODE = SimpleDiagnosticFactory.create(ERROR, "Unreachable code");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun test() {
|
||||
val a : Any? = null
|
||||
var a : Any? = null
|
||||
if (a is Any) else a = null;
|
||||
while (a is Any) a = null
|
||||
while (true) a = null
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fun test() {
|
||||
val a : Any? = null
|
||||
var a : Any? = null
|
||||
if (a is Any) else a = null;
|
||||
while (a is Any) a = null
|
||||
while (true) a = null
|
||||
|
||||
@@ -107,11 +107,15 @@ public class JetControlFlowTest extends JetTestCaseBase {
|
||||
//check edges directions
|
||||
Collection<Instruction> instructions = pseudocode.getInstructions();
|
||||
for (Instruction instruction : instructions) {
|
||||
for (Instruction nextInstruction : instruction.getNextInstructions()) {
|
||||
assertTrue("instruction: " + instruction + " next: " + nextInstruction, nextInstruction.getPreviousInstructions().contains(instruction));
|
||||
}
|
||||
for (Instruction prevInstruction : instruction.getPreviousInstructions()) {
|
||||
assertTrue("instruction: " + instruction + " prev: " + prevInstruction, prevInstruction.getNextInstructions().contains(instruction));
|
||||
if (!((InstructionImpl) instruction).isDead()) {
|
||||
for (Instruction nextInstruction : instruction.getNextInstructions()) {
|
||||
assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa",
|
||||
nextInstruction.getPreviousInstructions().contains(instruction));
|
||||
}
|
||||
for (Instruction prevInstruction : instruction.getPreviousInstructions()) {
|
||||
assertTrue("instruction '" + instruction + "' has '" + prevInstruction + "' among previous instructions list, but not vice versa",
|
||||
prevInstruction.getNextInstructions().contains(instruction));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user