Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
Add issue reference to test and provide additional test cases.

Original Pull Request: #3343
  • Loading branch information
christophstrobl committed Feb 1, 2024
1 parent 786024b commit a1ebea0
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.antlr.v4.runtime.CommonTokenStream;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

/**
* Tests built around examples of HQL found in
Expand Down Expand Up @@ -1636,8 +1638,17 @@ group by extract(epoch from departureTime)
""");
}

@Test
void queryWithSignedNumericLiteralShouldWork() {
assertQuery("select -1");
@ParameterizedTest // GH-3342
@ValueSource(strings = {
"select 1 from User",
"select -1 from User",
"select +1 from User",
"select +1*-100 from User",
"select count(u)*-0.7f from User u",
"select count(oi) + (-100) as perc from StockOrderItem oi",
"select p from Payment p where length(p.cardNumber) between +16 and -20"
})
void signedLiteralShouldWork(String query) {
assertQuery(query);
}
}

0 comments on commit a1ebea0

Please sign in to comment.