forked from JavaTX/JavaCompilerCore
modified: src/test/java/AllgemeinTest.java
new file: src/test/resources/AllgemeinTest/M.jav new file: src/test/resources/AllgemeinTest/Put.jav new file: src/test/resources/AllgemeinTest/Test.jav new file: src/test/resources/AllgemeinTest/TestSubTypless.jav new file: src/test/resources/AllgemeinTest/Twice.jav new file: src/test/resources/AllgemeinTest/Var.jav new file: src/test/resources/AllgemeinTest/Wildcard_Andi.jav new file: src/test/resources/AllgemeinTest/addList.jav
This commit is contained in:
parent
2f3d3e1bb9
commit
9fc558c21a
@ -41,7 +41,10 @@ public class AllgemeinTest {
|
|||||||
//String className = "Var";
|
//String className = "Var";
|
||||||
//String className = "Put";
|
//String className = "Put";
|
||||||
//String className = "Twice";
|
//String className = "Twice";
|
||||||
String className = "TestSubTypless";
|
//String className = "TestSubTypless";
|
||||||
|
//String className = "addList";
|
||||||
|
//String className = "M";
|
||||||
|
String className = "Wildcard_Andi";
|
||||||
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
|
//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/" + className + ".jav";
|
||||||
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
|
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
|
||||||
|
7
src/test/resources/AllgemeinTest/M.jav
Executable file
7
src/test/resources/AllgemeinTest/M.jav
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
import java.util.List;
|
||||||
|
class M {
|
||||||
|
void m(p, p2){
|
||||||
|
|
||||||
|
new addList().addLists(p, p2);
|
||||||
|
}
|
||||||
|
}
|
19
src/test/resources/AllgemeinTest/Put.jav
Normal file
19
src/test/resources/AllgemeinTest/Put.jav
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import java.util.Vector;
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
class Put {
|
||||||
|
|
||||||
|
putElement(ele, v) {
|
||||||
|
v.addElement(ele);
|
||||||
|
}
|
||||||
|
|
||||||
|
putElement(ele, s) {
|
||||||
|
s.push(ele);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
main(ele, x) {
|
||||||
|
putElement(ele, x);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
4
src/test/resources/AllgemeinTest/Test.jav
Normal file
4
src/test/resources/AllgemeinTest/Test.jav
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class Test {
|
||||||
|
a;
|
||||||
|
Test b;
|
||||||
|
}
|
12
src/test/resources/AllgemeinTest/TestSubTypless.jav
Normal file
12
src/test/resources/AllgemeinTest/TestSubTypless.jav
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
class TestSubTypless {
|
||||||
|
m(a){
|
||||||
|
var l = new ArrayList<>();
|
||||||
|
l.add(a);
|
||||||
|
return m2(l).get(0);
|
||||||
|
}
|
||||||
|
m2(a){
|
||||||
|
return m(a);
|
||||||
|
}
|
||||||
|
}
|
3
src/test/resources/AllgemeinTest/Twice.jav
Normal file
3
src/test/resources/AllgemeinTest/Twice.jav
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class Twice {
|
||||||
|
twice = f -> x -> f.apply(f.apply(x));
|
||||||
|
}
|
5
src/test/resources/AllgemeinTest/Var.jav
Normal file
5
src/test/resources/AllgemeinTest/Var.jav
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class Var {
|
||||||
|
|
||||||
|
var(x) { var y; }
|
||||||
|
|
||||||
|
}
|
8
src/test/resources/AllgemeinTest/Wildcard_Andi.jav
Normal file
8
src/test/resources/AllgemeinTest/Wildcard_Andi.jav
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
class Wildcard_Andi {
|
||||||
|
|
||||||
|
Test<? extends A> ex = new Test<>();
|
||||||
|
|
||||||
|
Test<? super A> sup = new Test<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
8
src/test/resources/AllgemeinTest/addList.jav
Executable file
8
src/test/resources/AllgemeinTest/addList.jav
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class addList {
|
||||||
|
addLists(a, b){
|
||||||
|
a.add(b.get(0));
|
||||||
|
b.add(a.get(0));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user