forked from JavaTX/JavaCompilerCore
Neue Testfälle in bytecode
This commit is contained in:
parent
29dea524a5
commit
eb3db718ad
8
test/bytecode/LambdaExpr2.jav
Normal file
8
test/bytecode/LambdaExpr2.jav
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
class LambdaExpr2 {
|
||||||
|
|
||||||
|
op = ()->method();
|
||||||
|
|
||||||
|
method() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
34
test/bytecode/LambdaExpr2.java
Normal file
34
test/bytecode/LambdaExpr2.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package bytecode;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import plugindevelopment.TypeInsertTester;
|
||||||
|
import de.dhbwstuttgart.core.MyCompiler;
|
||||||
|
import de.dhbwstuttgart.core.MyCompilerAPI;
|
||||||
|
import de.dhbwstuttgart.logger.LoggerConfiguration;
|
||||||
|
import de.dhbwstuttgart.logger.Section;
|
||||||
|
import de.dhbwstuttgart.parser.JavaParser.yyException;
|
||||||
|
import de.dhbwstuttgart.typeinference.ByteCodeResult;
|
||||||
|
import de.dhbwstuttgart.typeinference.Menge;
|
||||||
|
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||||
|
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
|
||||||
|
|
||||||
|
public class LambdaExpr2 {
|
||||||
|
|
||||||
|
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
|
||||||
|
public final static String testFile = "LambdaExpr2.jav";
|
||||||
|
public final static String outputFile = "LambdaExpr2.class";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
6
test/bytecode/Test3.java
Normal file
6
test/bytecode/Test3.java
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class Test3{
|
||||||
|
|
||||||
|
public static void main(String[] args){
|
||||||
|
System.out.println(new LambdaExpr2().op.apply());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user