diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-23 09:23:38 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-23 10:39:24 +0700 |
commit | c708962d7e0341133790bf7315257db7aa5acc86 (patch) | |
tree | 3ec1d766c31843dab259ac4f1a4ac0790b0d380c /tests/src | |
parent | 2af1b06b6a9439109520b249b5e44dfc1375c199 (diff) | |
download | aspectj-c708962d7e0341133790bf7315257db7aa5acc86.tar.gz aspectj-c708962d7e0341133790bf7315257db7aa5acc86.zip |
Add regression test for #257
Relates to #257.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java | 9 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml | 41 |
2 files changed, 50 insertions, 0 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java index e1f3fa1ca..b1942f11b 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java @@ -79,6 +79,15 @@ public class Bugs1920Tests extends XMLBasedAjcTestCase { runTest("do not match bridge methods"); } + /** + * In 1.9.20, a regression bug occurred, matching negated types like '!void' and '!String' incorrectly. + * <p> + * See <a href="https://github.com/eclipse-aspectj/aspectj/issues/257">GitHub issue 257</a>. + */ + public void test_GitHub_257() { + runTest("handle negated type patterns correctly"); + } + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs1920Tests.class); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml index 89c9b5f41..86fa7db02 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml @@ -434,4 +434,45 @@ </run> </ajc-test> + <!-- https://github.com/eclipse-aspectj/aspectj/issues/257 --> + <ajc-test dir="bugs1921/gh_257" vm="8" title="handle negated type patterns correctly"> + <compile files="NegatedTypeAspect.aj" options="-8"/> + <run class="NegatedTypeAspect"> + <stdout> + <line text="[SETTER] execution(void Person.setId(int))"/> + <line text="[SETTER] execution(void Person.setFirstName(String))"/> + <line text="[SETTER] execution(void Person.setLastName(String))"/> + <line text="Person(id=11, lastName='Curie', firstName='Marie')"/> + <line text="[GETTER] execution(int Person.getId())"/> + <line text="[NON-STRING GETTER] execution(int Person.getId())"/> + <line text="[NON-STRING-ARRAY GETTER] execution(int Person.getId())"/> + <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(int Person.getId())"/> + <line text="[GETTER] execution(String Person.getFirstName())"/> + <line text="[NON-STRING-ARRAY GETTER] execution(String Person.getFirstName())"/> + <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(String Person.getFirstName())"/> + <line text="[GETTER] execution(String Person.getLastName())"/> + <line text="[NON-STRING-ARRAY GETTER] execution(String Person.getLastName())"/> + <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(String Person.getLastName())"/> + <line text="Marie Curie"/> + <line text="[SETTER] execution(void Person.setFullName(String))"/> + <line text="[SETTER] execution(void Person.setId(int))"/> + <line text="Person(id=22, lastName='Einstein', firstName='Albert')"/> + <line text="Einstein, Albert"/> + <line text="[NON-STRING GETTER] execution(void Person.getVoid())"/> + <line text="[NON-STRING-ARRAY GETTER] execution(void Person.getVoid())"/> + <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(void Person.getVoid())"/> + <line text="[GETTER] execution(String[] Person.getStringArray())"/> + <line text="[NON-STRING GETTER] execution(String[] Person.getStringArray())"/> + <line text="[STRING-ARRAY GETTER] execution(String[] Person.getStringArray())"/> + <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(String[] Person.getStringArray())"/> + <line text="[Hello, world]"/> + <line text="[GETTER] execution(String[][] Person.getStringArrayArray())"/> + <line text="[NON-STRING GETTER] execution(String[][] Person.getStringArrayArray())"/> + <line text="[NON-STRING-ARRAY GETTER] execution(String[][] Person.getStringArrayArray())"/> + <line text="[[Hello, world], [Hallo, Welt]]"/> + <line text="AspectJ rules!"/> + </stdout> + </run> + </ajc-test> + </suite> |