We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version <dependency> <groupId>com.alibaba</groupId> <artifactId>QLExpress</artifactId> <version>3.3.4</version> </dependency>
<dependency> <groupId>com.alibaba</groupId> <artifactId>QLExpress</artifactId> <version>3.3.4</version> </dependency>
test code ` @test public void contextLoads_01() throws Exception {
DefaultContext<String, Object> context = new DefaultContext<>(); context.put("a", 1); context.put("b", 2); context.put("c", 3); String express = "a + b * c + a"; Object r = runner.execute(express, context, null, true, false); assertEquals("8", r.toString(), r.toString()); } @Test public void contextLoads_03() throws Exception { DefaultContext<String, Object> context = new DefaultContext<>(); context.put("b", 2); context.put("c", 3); context.put("a", 5); String express = "(a == 1) || ( b = 2) && ( c = 3 ) "; // 会抛出异常 com.ql.util.express.exception.QLException: run QlExpress Exception at line 1 :指令错误:2 不是Boolean Object r = runner.execute(express, context, null, true, false); assertEquals("true", r.toString(), r.toString()); } @Test public void contextLoads_04() throws Exception { DefaultContext<String, Object> context = new DefaultContext<>(); context.put("a", 1); context.put("b", 2); context.put("c", 3); String express = "(a == 1) || ( b = 2) && ( c = 3 ) "; //执行正常 Object r = runner.execute(express, context, null, true, false); assertEquals("true", r.toString(), r.toString()); } @Test public void contextLoads_04_01() throws Exception { DefaultContext<String, Object> context = new DefaultContext<>(); context.put("a", 1); context.put("b", 2); context.put("c", 3); String express = "(a == 1) || ( b == 2) && ( c == 3 ) "; //执行正常 Object r = runner.execute(express, context, null, true, false); assertEquals("true", r.toString(), r.toString()); } @Test public void contextLoads_05() throws Exception { DefaultContext<String, Object> context = new DefaultContext<>(); context.put("a", 1); context.put("b", 2); context.put("c", 3); String express = "(a == 5) || ( b = 2) && ( c = 3 ) "; //执行异常 com.ql.util.express.exception.QLException: run QlExpress Exception at line 1 :指令错误:2 不是Boolean Object r = runner.execute(express, context, null, true, false); assertEquals("true", r.toString(), r.toString()); }
`
The text was updated successfully, but these errors were encountered:
= 是赋值,会返回被赋予的值。 == 才是判断相等
=
==
Sorry, something went wrong.
No branches or pull requests
version
<dependency> <groupId>com.alibaba</groupId> <artifactId>QLExpress</artifactId> <version>3.3.4</version> </dependency>
test code
`
@test
public void contextLoads_01() throws Exception {
`
The text was updated successfully, but these errors were encountered: