]> source.dussan.org Git - aspectj.git/commitdiff
first textblock test for Java13
authorAndy Clement <aclement@pivotal.io>
Mon, 25 Nov 2019 19:05:45 +0000 (11:05 -0800)
committerAndy Clement <aclement@pivotal.io>
Mon, 25 Nov 2019 19:05:45 +0000 (11:05 -0800)
tests/features195/textblock/Code.java [new file with mode: 0644]
tests/features195/textblock/Code2.java [new file with mode: 0644]
tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java
tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml

diff --git a/tests/features195/textblock/Code.java b/tests/features195/textblock/Code.java
new file mode 100644 (file)
index 0000000..89df1e5
--- /dev/null
@@ -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 (file)
index 0000000..f0b39e0
--- /dev/null
@@ -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
+                       """);
+  }
+}
+
index 71219a5d253c4cc0f65945066884dc041be579d5..ef674b4048f646c695b64f77ad10d49e1a4223d9 100644 (file)
@@ -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() {
index c21529061f2ec299bd411c68e7b3992a3a0f326d..1084faf913d060be0ab9206d0972b00d6f63ff15 100644 (file)
                </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>