From 9fc558c21a320692fcfb233e2233a227f0e2799e Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Thu, 28 Jul 2022 09:04:25 +0200 Subject: [PATCH] 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 --- src/test/java/AllgemeinTest.java | 5 ++++- src/test/resources/AllgemeinTest/M.jav | 7 +++++++ src/test/resources/AllgemeinTest/Put.jav | 19 +++++++++++++++++++ src/test/resources/AllgemeinTest/Test.jav | 4 ++++ .../AllgemeinTest/TestSubTypless.jav | 12 ++++++++++++ src/test/resources/AllgemeinTest/Twice.jav | 3 +++ src/test/resources/AllgemeinTest/Var.jav | 5 +++++ .../resources/AllgemeinTest/Wildcard_Andi.jav | 8 ++++++++ src/test/resources/AllgemeinTest/addList.jav | 8 ++++++++ 9 files changed, 70 insertions(+), 1 deletion(-) create mode 100755 src/test/resources/AllgemeinTest/M.jav create mode 100644 src/test/resources/AllgemeinTest/Put.jav create mode 100644 src/test/resources/AllgemeinTest/Test.jav create mode 100644 src/test/resources/AllgemeinTest/TestSubTypless.jav create mode 100644 src/test/resources/AllgemeinTest/Twice.jav create mode 100644 src/test/resources/AllgemeinTest/Var.jav create mode 100644 src/test/resources/AllgemeinTest/Wildcard_Andi.jav create mode 100755 src/test/resources/AllgemeinTest/addList.jav diff --git a/src/test/java/AllgemeinTest.java b/src/test/java/AllgemeinTest.java index 50a67b381..92b2314a4 100644 --- a/src/test/java/AllgemeinTest.java +++ b/src/test/java/AllgemeinTest.java @@ -41,7 +41,10 @@ public class AllgemeinTest { //String className = "Var"; //String className = "Put"; //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 path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/" + className + ".jav"; //path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav"; diff --git a/src/test/resources/AllgemeinTest/M.jav b/src/test/resources/AllgemeinTest/M.jav new file mode 100755 index 000000000..39e6d4828 --- /dev/null +++ b/src/test/resources/AllgemeinTest/M.jav @@ -0,0 +1,7 @@ +import java.util.List; +class M { +void m(p, p2){ + + new addList().addLists(p, p2); +} +} diff --git a/src/test/resources/AllgemeinTest/Put.jav b/src/test/resources/AllgemeinTest/Put.jav new file mode 100644 index 000000000..b22977c62 --- /dev/null +++ b/src/test/resources/AllgemeinTest/Put.jav @@ -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); + } + +} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Test.jav b/src/test/resources/AllgemeinTest/Test.jav new file mode 100644 index 000000000..3d505a850 --- /dev/null +++ b/src/test/resources/AllgemeinTest/Test.jav @@ -0,0 +1,4 @@ +class Test { + a; + Test b; +} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/TestSubTypless.jav b/src/test/resources/AllgemeinTest/TestSubTypless.jav new file mode 100644 index 000000000..667fe6e72 --- /dev/null +++ b/src/test/resources/AllgemeinTest/TestSubTypless.jav @@ -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); + } +} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Twice.jav b/src/test/resources/AllgemeinTest/Twice.jav new file mode 100644 index 000000000..396bc5e2a --- /dev/null +++ b/src/test/resources/AllgemeinTest/Twice.jav @@ -0,0 +1,3 @@ +class Twice { + twice = f -> x -> f.apply(f.apply(x)); +} diff --git a/src/test/resources/AllgemeinTest/Var.jav b/src/test/resources/AllgemeinTest/Var.jav new file mode 100644 index 000000000..b95b36679 --- /dev/null +++ b/src/test/resources/AllgemeinTest/Var.jav @@ -0,0 +1,5 @@ +class Var { + + var(x) { var y; } + +} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Wildcard_Andi.jav b/src/test/resources/AllgemeinTest/Wildcard_Andi.jav new file mode 100644 index 000000000..30ef7806e --- /dev/null +++ b/src/test/resources/AllgemeinTest/Wildcard_Andi.jav @@ -0,0 +1,8 @@ +class Wildcard_Andi { + + Test ex = new Test<>(); + + Test sup = new Test<>(); + } + + diff --git a/src/test/resources/AllgemeinTest/addList.jav b/src/test/resources/AllgemeinTest/addList.jav new file mode 100755 index 000000000..a72023eac --- /dev/null +++ b/src/test/resources/AllgemeinTest/addList.jav @@ -0,0 +1,8 @@ +import java.util.List; + +class addList { + addLists(a, b){ +a.add(b.get(0)); +b.add(a.get(0)); +} +}