Add Cycle Test
This commit is contained in:
parent
a4bc49f5c4
commit
5bfe2c906e
@ -40,7 +40,7 @@ public class AllgemeinTest {
|
||||
//String className = "FCTest3";
|
||||
//String className = "Var";
|
||||
//String className = "Put";
|
||||
String className = "Twice";
|
||||
String className = "Cycle";
|
||||
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
|
||||
path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/" + className + ".jav";
|
||||
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
|
||||
|
@ -9,6 +9,7 @@ import de.dhbwstuttgart.bytecode.insertGenerics.PositionFinder;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -26,6 +27,7 @@ public class TestExample42 {
|
||||
}
|
||||
|
||||
public HashMap<String, PositionFinder.Position> fillPosOfTphs() {
|
||||
BufferedReader l;
|
||||
HashMap<String, PositionFinder.Position> posOfTphs = new HashMap<>();
|
||||
posOfTphs.put("K", PositionFinder.Position.FIELD);
|
||||
posOfTphs.put("L", PositionFinder.Position.METHOD);
|
||||
|
11
src/test/resources/AllgemeinTest/Cycle.jav
Normal file
11
src/test/resources/AllgemeinTest/Cycle.jav
Normal file
@ -0,0 +1,11 @@
|
||||
class Cycle{
|
||||
|
||||
<A> A und(A a, A b){
|
||||
return a;
|
||||
}
|
||||
|
||||
m(a){
|
||||
return und(m(m(a)), a);
|
||||
}
|
||||
|
||||
}
|
5
src/test/resources/AllgemeinTest/Twice.jav
Normal file
5
src/test/resources/AllgemeinTest/Twice.jav
Normal file
@ -0,0 +1,5 @@
|
||||
class Twice{
|
||||
m(x, f){
|
||||
return f.apply(f.apply(x));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user