Пример #1
0
 @Test(timeout = 10000)
 public void testSqrt() throws ConfigCompileException {
   assertEquals("3", StaticTest.SRun("sqrt(9)", fakePlayer));
   assertEquals(
       "Test failed",
       java.lang.Math.sqrt(2),
       Double.parseDouble(StaticTest.SRun("sqrt(2)", fakePlayer)),
       .000001);
   try {
     StaticTest.SRun("sqrt(-1)", fakePlayer);
     fail("Did not expect to pass");
   } catch (ConfigRuntimeException e) {
     // pass
   }
 }
Пример #2
0
 @Test(timeout = 10000)
 public void testMax() throws ConfigCompileException {
   assertEquals("50", StaticTest.SRun("max(6, 7, array(4, 4, 50), 2, 5)", fakePlayer));
 }
Пример #3
0
 @Test(timeout = 10000)
 public void testMin() throws ConfigCompileException {
   assertEquals("-2", StaticTest.SRun("min(2, array(5, 6, 4), -2)", fakePlayer));
 }