Search in sources :

Example 1 with SimpleSpeedTest

use of org.nutz.el.speed.SimpleSpeedTest in project nutz by nutzam.

the class El2Test method speed.

@Test
public void speed() {
    SimpleSpeedTest z = new SimpleSpeedTest();
    int num = 4988;
    String elstr = "num + (i - 1 + 2 - 3 + 4 - 5 + 6 - 7)-z.abc(i)";
    int i = 5000;
    Context con = Lang.context();
    con.set("num", num);
    con.set("i", i);
    con.set("z", z);
    assertEquals(num + (i - 1 + 2 - 3 + 4 - 5 + 6 - 7) - z.abc(i), El.eval(con, elstr));
}
Also used : Context(org.nutz.lang.util.Context) SimpleSpeedTest(org.nutz.el.speed.SimpleSpeedTest) SimpleSpeedTest(org.nutz.el.speed.SimpleSpeedTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SimpleSpeedTest (org.nutz.el.speed.SimpleSpeedTest)1 Context (org.nutz.lang.util.Context)1