use of cn.hutool.extra.expression.engine.jexl.JexlEngine in project hutool by looly.
the class ExpressionUtilTest method jexlTest.
@Test
public void jexlTest() {
ExpressionEngine engine = new JexlEngine();
final Dict dict = Dict.create().set("a", 100.3).set("b", 45).set("c", -199.100);
final Object eval = engine.eval("a-(b-c)", dict);
Assert.assertEquals(-143.8, (double) eval, 2);
}
use of cn.hutool.extra.expression.engine.jexl.JexlEngine in project hutool by dromara.
the class ExpressionUtilTest method jexlTest.
@Test
public void jexlTest() {
ExpressionEngine engine = new JexlEngine();
final Dict dict = Dict.create().set("a", 100.3).set("b", 45).set("c", -199.100);
final Object eval = engine.eval("a-(b-c)", dict);
Assert.assertEquals(-143.8, (double) eval, 2);
}
Aggregations