use of cn.taketoday.expression.spel.ast.Operator in project today-framework by TAKETODAY.
the class OperatorTests method testOperatorNames.
@Test
void testOperatorNames() {
Operator node = getOperatorNode((SpelExpression) parser.parseExpression("1==3"));
assertThat(node.getOperatorName()).isEqualTo("==");
node = getOperatorNode((SpelExpression) parser.parseExpression("1!=3"));
assertThat(node.getOperatorName()).isEqualTo("!=");
node = getOperatorNode((SpelExpression) parser.parseExpression("3/3"));
assertThat(node.getOperatorName()).isEqualTo("/");
node = getOperatorNode((SpelExpression) parser.parseExpression("3+3"));
assertThat(node.getOperatorName()).isEqualTo("+");
node = getOperatorNode((SpelExpression) parser.parseExpression("3-3"));
assertThat(node.getOperatorName()).isEqualTo("-");
node = getOperatorNode((SpelExpression) parser.parseExpression("3<4"));
assertThat(node.getOperatorName()).isEqualTo("<");
node = getOperatorNode((SpelExpression) parser.parseExpression("3<=4"));
assertThat(node.getOperatorName()).isEqualTo("<=");
node = getOperatorNode((SpelExpression) parser.parseExpression("3*4"));
assertThat(node.getOperatorName()).isEqualTo("*");
node = getOperatorNode((SpelExpression) parser.parseExpression("3%4"));
assertThat(node.getOperatorName()).isEqualTo("%");
node = getOperatorNode((SpelExpression) parser.parseExpression("3>=4"));
assertThat(node.getOperatorName()).isEqualTo(">=");
node = getOperatorNode((SpelExpression) parser.parseExpression("3 between 4"));
assertThat(node.getOperatorName()).isEqualTo("between");
node = getOperatorNode((SpelExpression) parser.parseExpression("3 ^ 4"));
assertThat(node.getOperatorName()).isEqualTo("^");
}
use of cn.taketoday.expression.spel.ast.Operator in project today-infrastructure by TAKETODAY.
the class OperatorTests method testOperatorNames.
@Test
void testOperatorNames() {
Operator node = getOperatorNode((SpelExpression) parser.parseExpression("1==3"));
assertThat(node.getOperatorName()).isEqualTo("==");
node = getOperatorNode((SpelExpression) parser.parseExpression("1!=3"));
assertThat(node.getOperatorName()).isEqualTo("!=");
node = getOperatorNode((SpelExpression) parser.parseExpression("3/3"));
assertThat(node.getOperatorName()).isEqualTo("/");
node = getOperatorNode((SpelExpression) parser.parseExpression("3+3"));
assertThat(node.getOperatorName()).isEqualTo("+");
node = getOperatorNode((SpelExpression) parser.parseExpression("3-3"));
assertThat(node.getOperatorName()).isEqualTo("-");
node = getOperatorNode((SpelExpression) parser.parseExpression("3<4"));
assertThat(node.getOperatorName()).isEqualTo("<");
node = getOperatorNode((SpelExpression) parser.parseExpression("3<=4"));
assertThat(node.getOperatorName()).isEqualTo("<=");
node = getOperatorNode((SpelExpression) parser.parseExpression("3*4"));
assertThat(node.getOperatorName()).isEqualTo("*");
node = getOperatorNode((SpelExpression) parser.parseExpression("3%4"));
assertThat(node.getOperatorName()).isEqualTo("%");
node = getOperatorNode((SpelExpression) parser.parseExpression("3>=4"));
assertThat(node.getOperatorName()).isEqualTo(">=");
node = getOperatorNode((SpelExpression) parser.parseExpression("3 between 4"));
assertThat(node.getOperatorName()).isEqualTo("between");
node = getOperatorNode((SpelExpression) parser.parseExpression("3 ^ 4"));
assertThat(node.getOperatorName()).isEqualTo("^");
}
Aggregations