Skip to content

Commit

Permalink
- additional test for end token
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Jan 30, 2025
1 parent c82a108 commit 45b58cc
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3589,6 +3589,22 @@ void endTokenInRhs() {
assertThat(ruleDescr.getConsequence().toString()).isEqualToIgnoringWhitespace("int end = 10;");
}

@Test
void endTokenWithSemiInRhs() {
final String text = "package org.drools\n" +
"rule X\n" +
"when\n" +
" $s : String()\n" +
"then\n" +
" int end = 10;" +
" int a = end;\n" +
"end;\n";
PackageDescr packageDescr = parseAndGetPackageDescr(text);

RuleDescr ruleDescr = packageDescr.getRules().get(0);
assertThat(ruleDescr.getConsequence().toString()).isEqualToIgnoringWhitespace("int end = 10; int a = end;");
}

@Test
void ruleTokenInRhs() {
final String text = "package org.drools\n" +
Expand Down

0 comments on commit 45b58cc

Please sign in to comment.