mirror of
https://github.com/apache/olingo-odata4.git
synced 2025-02-06 01:59:12 +00:00
OLINGO-1245: allow to define a full boolean expression with surrounding 'not' logical operator with parens surrounding the boolean expression
This commit is contained in:
parent
e18c6fa184
commit
243708f168
@ -313,7 +313,7 @@ public class ExpressionParser {
|
||||
}
|
||||
return new UnaryImpl(UnaryOperatorKind.MINUS, expression, getType(expression));
|
||||
} else if (tokenizer.next(TokenKind.NotOperator)) {
|
||||
final Expression expression = parseExprPrimary();
|
||||
final Expression expression = parseExprValue();
|
||||
checkType(expression, EdmPrimitiveTypeKind.Boolean);
|
||||
checkNoCollection(expression);
|
||||
return new UnaryImpl(UnaryOperatorKind.NOT, expression, getType(expression));
|
||||
|
@ -171,7 +171,9 @@ public class ExpressionParserTest {
|
||||
@Test
|
||||
public void filterUnaryOperators() throws Exception {
|
||||
testFilter.runOnETAllPrim("not PropertyBoolean").is("<not <PropertyBoolean>>");
|
||||
testFilter.runOnETAllPrim("not (PropertyBoolean)").is("<not <PropertyBoolean>>");
|
||||
testFilter.runOnETAllPrim("-PropertyInt16 eq PropertyInt16").is("<<- <PropertyInt16>> eq <PropertyInt16>>");
|
||||
testFilter.runOnETAllPrim("not (PropertyString eq null)").is("<not <<PropertyString> eq <null>>>");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user