aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2023-12-10 13:53:15 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2023-12-11 03:38:37 +0100
commit6be5a0a6a62e9afefad53a27f4c75d95ae7dac74 (patch)
tree5e289540803e9b6a1b938e2d159f9584fb91205e /tests/src
parent920e9f5f15dc8e4e2962357f351bf74c7d9b666e (diff)
downloadaspectj-6be5a0a6a62e9afefad53a27f4c75d95ae7dac74.tar.gz
aspectj-6be5a0a6a62e9afefad53a27f4c75d95ae7dac74.zip
Add tests for Java 21 string patterns
TODO: Due to eclipse-jdt/eclipse.jdt.core#1719, one line per test is currently rendered incorrectly. After the upstream fix, change "\Bill \Duck" to "Bill Duck". Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java8
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml71
2 files changed, 77 insertions, 2 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java
index 4b4de845d..5ef087602 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java
@@ -16,8 +16,12 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava21Only;
*/
public class Java21PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava21Only {
- public void testDummyPreviewJava21() {
- //runTest("dummy preview Java 21");
+ public void testStringPatterns() {
+ runTest("string patterns");
+ }
+
+ public void testStringPatternsAspect() {
+ runTest("string patterns aspect");
}
public static Test suite() {
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml
index 42a58da0c..a7b5d0d95 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml
@@ -188,4 +188,75 @@
</run>
</ajc-test>
+ <!-- Java 21 preview -->
+ <ajc-test dir="features1921/java21" vm="21" title="string patterns">
+ <compile files="StringPatternsPreview1.java" options="--enable-preview -21"/>
+ <run class="StringPatternsPreview1" vmargs="--enable-preview">
+ <stdout ordered="yes">
+ <!-- TODO: Due to https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1719, this is currently rendered
+ incorrectly. After the upstream fix, change "\Bill \Duck" to "Bill Duck". -->
+ <line text="\Bill \Duck"/>
+ <line text="10 + 20 = 30"/>
+ <line text="You have a special New Year's sale discount waiting for you!"/>
+ <line text="Access at 2011-11-11 11:11:11 from localhost/127.0.0.1"/>
+ <line text="The file _dummy.dat does not exist"/>
+ <line text="The time is 11:11:11 or roughly eleven after eleven"/>
+ <line text="apples, oranges, peaches"/>
+ <line text=""/>
+ <line text="&lt;html&gt;"/>
+ <line text=" &lt;head&gt;"/>
+ <line text=" &lt;title&gt;My Web Page&lt;/title&gt;"/>
+ <line text=" &lt;/head&gt;"/>
+ <line text=" &lt;body&gt;"/>
+ <line text=" &lt;p&gt;Hello, world&lt;/p&gt;"/>
+ <line text=" &lt;/body&gt;"/>
+ <line text="&lt;/html&gt;"/>
+ <line text=""/>
+ <line text="Description Width Height Area"/>
+ <line text="Alfa 17.80 31.40 558.92"/>
+ <line text="Bravo 9.60 12.40 119.04"/>
+ <line text="Charlie 7.10 11.23 79.73"/>
+ <line text=" Total 757.69"/>
+ <line text=""/>
+ <line text="My name is Joan"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java 21 preview -->
+ <ajc-test dir="features1921/java21" vm="21" title="string patterns aspect">
+ <compile files="StringPatternsPreview1Aspect.aj" options="--enable-preview -21"/>
+ <run class="StringPatternsPreview1Aspect" vmargs="--enable-preview">
+ <stdout ordered="yes">
+ <line text="execution(void StringPatternsPreview1Aspect.main(String[]))"/>
+ <!-- TODO: Due to https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1719, this is currently rendered
+ incorrectly. After the upstream fix, change "\Bill \Duck" to "Bill Duck". -->
+ <line text="\Bill \Duck"/>
+ <line text="10 + 20 = 30"/>
+ <line text="You have a special New Year's sale discount waiting for you!"/>
+ <line text="Access at 2011-11-11 11:11:11 from localhost/127.0.0.1"/>
+ <line text="The file _dummy.dat does not exist"/>
+ <line text="The time is 11:11:11 or roughly eleven after eleven"/>
+ <line text="apples, oranges, peaches"/>
+ <line text=""/>
+ <line text="&lt;html&gt;"/>
+ <line text=" &lt;head&gt;"/>
+ <line text=" &lt;title&gt;My Web Page&lt;/title&gt;"/>
+ <line text=" &lt;/head&gt;"/>
+ <line text=" &lt;body&gt;"/>
+ <line text=" &lt;p&gt;Hello, world&lt;/p&gt;"/>
+ <line text=" &lt;/body&gt;"/>
+ <line text="&lt;/html&gt;"/>
+ <line text=""/>
+ <line text="Description Width Height Area"/>
+ <line text="Alfa 17.80 31.40 558.92"/>
+ <line text="Bravo 9.60 12.40 119.04"/>
+ <line text="Charlie 7.10 11.23 79.73"/>
+ <line text=" Total 757.69"/>
+ <line text=""/>
+ <line text="My name is Joan"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>