From b2b46ce365939bee3ed9f5840b43bb88edf13e93 Mon Sep 17 00:00:00 2001 From: acolyer <acolyer> Date: Fri, 19 Aug 2005 13:22:37 +0000 Subject: tests for pr78707, before returning and before throwing advice --- tests/bugs150/pr78707.aj | 11 +++++++++++ tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 ++++ tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/bugs150/pr78707.aj diff --git a/tests/bugs150/pr78707.aj b/tests/bugs150/pr78707.aj new file mode 100644 index 000000000..a97c8cc1c --- /dev/null +++ b/tests/bugs150/pr78707.aj @@ -0,0 +1,11 @@ +public aspect pr78707 { + + before() returning : execution(* *(..)) { + // yeah, right! + } + + before() throwing : execution(* *(..)) { + System.out.println("I'm not flippin' phsycic you know!"); + } + +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 7b2c8327e..bff207258 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -226,6 +226,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("before and after are valid identifiers in classes"); } + public void testNoBeforeReturningAdvice() { + runTest("before returning advice not allowed!"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 6bf54de53..67d12f90f 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -67,6 +67,13 @@ </compile> </ajc-test> + <ajc-test dir="bugs150" pr="78707" title="before returning advice not allowed!"> + <compile files="pr78707.aj"> + <message line="3" kind="error" text="Syntax error on token "returning", delete this token"/> + <message line="3" kind="error" text="Syntax error on token "throwing", delete this token"/> + </compile> + </ajc-test> + <ajc-test dir="bugs150" pr="107059" title="parser crashes on call(void (@a *)(..)"> <compile files="pr107059.aj"> <message line="3" kind="error" text="Syntax error on token "(", "name pattern" expected"/> -- cgit v1.2.3