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);
|
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);
|
PsiElementOnlyDiagnosticFactory1<JetSimpleNameExpression, DeclarationDescriptor> VAL_REASSIGNMENT = PsiElementOnlyDiagnosticFactory1.create(ERROR, "Val can not be reassigned", NAME);
|
||||||
|
|
||||||
SimpleDiagnosticFactory UNREACHABLE_CODE = SimpleDiagnosticFactory.create(ERROR, "Unreachable code");
|
SimpleDiagnosticFactory UNREACHABLE_CODE = SimpleDiagnosticFactory.create(ERROR, "Unreachable code");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fun test() {
|
fun test() {
|
||||||
val a : Any? = null
|
var a : Any? = null
|
||||||
if (a is Any) else a = null;
|
if (a is Any) else a = null;
|
||||||
while (a is Any) a = null
|
while (a is Any) a = null
|
||||||
while (true) a = null
|
while (true) a = null
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fun test() {
|
fun test() {
|
||||||
val a : Any? = null
|
var a : Any? = null
|
||||||
if (a is Any) else a = null;
|
if (a is Any) else a = null;
|
||||||
while (a is Any) a = null
|
while (a is Any) a = null
|
||||||
while (true) a = null
|
while (true) a = null
|
||||||
|
|||||||
@@ -107,11 +107,15 @@ public class JetControlFlowTest extends JetTestCaseBase {
|
|||||||
//check edges directions
|
//check edges directions
|
||||||
Collection<Instruction> instructions = pseudocode.getInstructions();
|
Collection<Instruction> instructions = pseudocode.getInstructions();
|
||||||
for (Instruction instruction : instructions) {
|
for (Instruction instruction : instructions) {
|
||||||
for (Instruction nextInstruction : instruction.getNextInstructions()) {
|
if (!((InstructionImpl) instruction).isDead()) {
|
||||||
assertTrue("instruction: " + instruction + " next: " + nextInstruction, nextInstruction.getPreviousInstructions().contains(instruction));
|
for (Instruction nextInstruction : instruction.getNextInstructions()) {
|
||||||
}
|
assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa",
|
||||||
for (Instruction prevInstruction : instruction.getPreviousInstructions()) {
|
nextInstruction.getPreviousInstructions().contains(instruction));
|
||||||
assertTrue("instruction: " + instruction + " prev: " + prevInstruction, prevInstruction.getNextInstructions().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