Testfälle bereinigen

This commit is contained in:
JanUlrich 2018-02-28 13:22:07 +01:00
parent b66d06a165
commit 9f9a94b5cf
13 changed files with 64 additions and 102 deletions

View File

@ -131,6 +131,9 @@ public class UnifyTypeFactory {
UnifyPair ret = generateEqualDotPair(UnifyTypeFactory.convert(p.TA1)
, UnifyTypeFactory.convert(p.TA2));
return ret;
}else if(p.GetOperator().equals(PairOperator.SMALLER)){
return generateSmallerPair(UnifyTypeFactory.convert(p.TA1),
UnifyTypeFactory.convert(p.TA2));
}else throw new NotImplementedException();
}

View File

@ -0,0 +1,8 @@
class Expressions{
void test(){
var x = 2;
x = x + 2;
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class FacultyTest extends JavaTXCompilerTest{
public FacultyTest() {
this.fileToTest = new File(rootDirectory+"Faculty.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class FiniteClosureTest extends JavaTXCompilerTest{
public FiniteClosureTest() {
// this.fileToTest = new File(rootDirectory+"fc.jav");
}
}

View File

@ -1,10 +0,0 @@
package typeinference;
import java.io.File;
//TODO: Hier gibt es einen Fehler. Das erstellte ConstraintSet stimmt nicht
public class GenericsTest extends JavaTXCompilerTest{
public GenericsTest() {
this.fileToTest = new File(rootDirectory+"Generics.jav");
}
}

View File

@ -23,19 +23,57 @@ import java.util.Set;
public class JavaTXCompilerTest {
public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/";
private static final List<File> filesToTest = new ArrayList<>();
protected File fileToTest = null;
public JavaTXCompilerTest(){
@Test
public void finiteClosure() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"fc.jav"));
}
@Test
public void test() throws IOException, ClassNotFoundException {
if(fileToTest != null)filesToTest.add(fileToTest);
else return;
//filesToTest.add(new File(rootDirectory+"Faculty.jav"));
//filesToTest.add(new File(rootDirectory+"mathStruc.jav"));
//filesToTest.add(new File(rootDirectory+"test.jav"));
filesToTest.add(new File(rootDirectory+"EmptyMethod.jav"));
public void lambda() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Lambda.jav"));
}
@Test
public void lambda2() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Lambda2.jav"));
}
@Test
public void lambda3() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Lambda3.jav"));
}
@Test
public void mathStruc() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"mathStruc.jav"));
}
@Test
public void generics() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Generics.jav"));
}
@Test
public void faculty() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Faculty.jav"));
}
@Test
public void matrix() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Matrix.jav"));
}
@Test
public void vector() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Vector.jav"));
}
@Test
public void lambdaRunnable() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"LambdaRunnable.jav"));
}
@Test
public void expressions() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"Expressions.jav"));
}
private static class TestResultSet{
}
public TestResultSet execute(File fileToTest) throws IOException, ClassNotFoundException {
//filesToTest.add(new File(rootDirectory+"fc.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda2.jav"));
@ -45,6 +83,9 @@ public class JavaTXCompilerTest {
//filesToTest.add(new File(rootDirectory+"MethodsEasy.jav"));
//filesToTest.add(new File(rootDirectory+"Matrix.jav"));
//filesToTest.add(new File(rootDirectory+"Import.jav"));
// //filesToTest.add(new File(rootDirectory+"Faculty.jav"));
// //filesToTest.add(new File(rootDirectory+"mathStruc.jav"));
// //filesToTest.add(new File(rootDirectory+"test.jav"));
JavaTXCompiler compiler = new JavaTXCompiler(fileToTest);
List<ResultSet> results = compiler.typeInference();
@ -68,6 +109,7 @@ public class JavaTXCompilerTest {
System.out.println(s);
}
}
return new TestResultSet();
}
static String readFile(String path, Charset encoding)

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class Lambda2Test extends JavaTXCompilerTest{
public Lambda2Test() {
this.fileToTest = new File(rootDirectory+"Lambda2.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class Lambda3Test extends JavaTXCompilerTest{
public Lambda3Test() {
this.fileToTest = new File(rootDirectory+"Lambda3.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class LambdaTest extends JavaTXCompilerTest{
public LambdaTest() {
this.fileToTest = new File(rootDirectory+"Lambda.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class MatrixTest extends JavaTXCompilerTest{
public MatrixTest() {
this.fileToTest = new File(rootDirectory+"Matrix.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class RunnableTest extends JavaTXCompilerTest{
public RunnableTest() {
this.fileToTest = new File(rootDirectory+"LambdaRunnable.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class VectorTest extends JavaTXCompilerTest{
public VectorTest() {
this.fileToTest = new File(rootDirectory+"Vector.jav");
}
}

View File

@ -1,9 +0,0 @@
package typeinference;
import java.io.File;
public class mathStrucTest extends JavaTXCompilerTest{
public mathStrucTest() {
this.fileToTest = new File(rootDirectory+"mathStruc.jav");
}
}