aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2019-11-25 11:05:45 -0800
committerAndy Clement <aclement@pivotal.io>2019-11-25 11:05:45 -0800
commitdda1ef9438ba73f35f9c50359705aa6e48c342a6 (patch)
treef4c68ea8093318a5877cc3991d8d3db6cf2a2865 /tests
parent2704db20ecca12d3bbe514a4f7b84d297937de86 (diff)
downloadaspectj-dda1ef9438ba73f35f9c50359705aa6e48c342a6.tar.gz
aspectj-dda1ef9438ba73f35f9c50359705aa6e48c342a6.zip
first textblock test for Java13
Diffstat (limited to 'tests')
-rw-r--r--tests/features195/textblock/Code.java9
-rw-r--r--tests/features195/textblock/Code2.java15
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java8
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml27
4 files changed, 59 insertions, 0 deletions
diff --git a/tests/features195/textblock/Code.java b/tests/features195/textblock/Code.java
new file mode 100644
index 000000000..89df1e537
--- /dev/null
+++ b/tests/features195/textblock/Code.java
@@ -0,0 +1,9 @@
+public class Code {
+ public static void main(String[] argv) {
+ System.out.println("""
+ this is a text
+ block
+ """);
+ }
+}
+
diff --git a/tests/features195/textblock/Code2.java b/tests/features195/textblock/Code2.java
new file mode 100644
index 000000000..f0b39e08b
--- /dev/null
+++ b/tests/features195/textblock/Code2.java
@@ -0,0 +1,15 @@
+public class Code2 {
+ public static void main(String[] argv) {
+ }
+}
+
+aspect X {
+
+ before(): execution(* Code2.main(..)) {
+ System.out.println("""
+ this is a text
+ block in advice
+ """);
+ }
+}
+
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java
index 71219a5d2..ef674b404 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java
@@ -24,6 +24,14 @@ public class Ajc195Tests extends XMLBasedAjcTestCase {
runTest("around finally blocks and unlinking");
}
+ public void testTextBlock1() {
+ runTest("textblock 1");
+ }
+
+ public void testTextBlock2() {
+ runTest("textblock 2");
+ }
+
// ---
public static Test suite() {
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml
index c21529061..1084faf91 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml
@@ -72,5 +72,32 @@
</stdout>
</run>
</ajc-test>
+
+
+ <ajc-test dir="features195/textblock" vm="13" title="textblock 1">
+ <compile files="Code.java" options="--enable-preview -source 13">
+ </compile>
+ <run class="Code" vmargs="--enable-preview">
+ <stdout>
+ <line text="this is a text"/>
+ <!-- the incidental space is removed with a trim in output matching but the test app doesn't remove it when printing it, why? -->
+ <line text="block"/>
+ <line text=""/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="features195/textblock" vm="13" title="textblock 2">
+ <compile files="Code2.java" options="--enable-preview -source 13">
+ </compile>
+ <run class="Code2" vmargs="--enable-preview">
+ <stdout>
+ <!-- why is the incidental space not removed here?? -->
+ <line text="this is a text"/>
+ <line text="block in advice"/>
+ <line text=""/>
+ </stdout>
+ </run>
+ </ajc-test>
</suite>