Added information about anonymous initializers to cfg & proper checks

This commit is contained in:
svtk
2011-11-01 18:54:33 +04:00
parent ecdceb4447
commit eab7fdf4bc
6 changed files with 109 additions and 9 deletions
@@ -32,7 +32,12 @@ public class JetControlFlowTest extends JetLiteFixture {
super(dataPath);
myName = name;
}
@Override
public String getName() {
return "test" + myName;
}
protected String getTestFilePath() {
return myFullDataPath + "/" + myName;
}
@@ -94,15 +99,19 @@ public class JetControlFlowTest extends JetLiteFixture {
int i = 0;
for (Pseudocode pseudocode : pseudocodes) {
JetElement correspondingElement = pseudocode.getCorrespondingElement();
String label;
assert correspondingElement instanceof JetNamedDeclaration;
String label = "";
assert (correspondingElement instanceof JetNamedDeclaration || correspondingElement instanceof JetConstructor) :
"Unexpected element class is pseudocode: " + correspondingElement.getClass();
if (correspondingElement instanceof JetFunctionLiteral) {
label = "anonymous_" + i++;
}
else {
else if (correspondingElement instanceof JetNamedDeclaration) {
JetNamedDeclaration namedDeclaration = (JetNamedDeclaration) correspondingElement;
label = namedDeclaration.getName();
}
else {
label = "this";
}
instructionDump.append("== ").append(label).append(" ==\n");