Skip to content

Commit

Permalink
- drop Annotation inside LHS
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Jan 24, 2025
1 parent 75bfe12 commit e59ed36
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4057,6 +4057,7 @@ void lhsPatternAnnotation() {
assertThat(annotationDescr.getSingleValueAsString()).isEqualTo("!*, age");
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void prefixAndDescrAnnotation() {
final String text =
Expand All @@ -4078,6 +4079,7 @@ void prefixAndDescrAnnotation() {
assertThat(andDescr.getDescrs()).hasSize(2);
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void prefixOrDescrAnnotation() {
final String text =
Expand All @@ -4100,6 +4102,7 @@ void prefixOrDescrAnnotation() {
assertThat(orDescr.getDescrs()).hasSize(2);
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void infixAndDescrAnnotation() {
final String text =
Expand All @@ -4120,6 +4123,7 @@ void infixAndDescrAnnotation() {
assertThat(andDescr.getDescrs()).hasSize(3);
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void infixOrDescrAnnotation() {
final String text =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ lhs : DRL_WHEN lhsExpression* ;
queryLhs : lhsExpression* ;

lhsExpression : LPAREN lhsExpression RPAREN #lhsExpressionEnclosed
| DRL_OR drlAnnotation* lhsExpression+ #lhsOr
| lhsExpression ((DRL_OR) drlAnnotation* lhsExpression)+ #lhsOr
| DRL_AND drlAnnotation* lhsExpression+ #lhsAnd
| lhsExpression ((DRL_AND) drlAnnotation* lhsExpression)+ #lhsAnd
| DRL_OR lhsExpression+ #lhsOr
| lhsExpression ((DRL_OR) lhsExpression)+ #lhsOr
| DRL_AND lhsExpression+ #lhsAnd
| lhsExpression ((DRL_AND) lhsExpression)+ #lhsAnd
| lhsUnary #lhsUnarySingle
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.drools.testcoverage.common.util.KieBaseUtil;
import org.drools.testcoverage.common.util.KieUtil;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieBase;
Expand Down Expand Up @@ -273,6 +274,7 @@ public void testAnnotationNameClashWithRegularClass(KieBaseTestConfiguration kie
int[] numbers();
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@ParameterizedTest(name = "KieBase type={0}")
@MethodSource("parameters")
public void testAnnotationOnLHSAndMerging(KieBaseTestConfiguration kieBaseTestConfiguration) {
Expand Down

0 comments on commit e59ed36

Please sign in to comment.