5758596061626364656667
} @Test public void testSpec05() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("fact = n -> n==0? 1: n*fact(n-1); fact(5)", Integer.class); Assert.assertEquals(Integer.valueOf(120), result); }
6768697071727374757677
} @Test public void testSpec06() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(x->y->x-y)(2)(1)", Integer.class); Assert.assertEquals(Integer.valueOf(1), result); }
7778798081828384858687
} @Test public void testInvocation01() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(()->2)()", Integer.class); Assert.assertEquals(Integer.valueOf(2), result); }
8788899091929394959697
} @Test public void testNested01() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(()->y->2-y)()(1)", Integer.class); Assert.assertEquals(Integer.valueOf(1), result); }
979899100101102103104105106107
} @Test public void testNested02() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(()->y->()->2-y)()(1)()", Integer.class); Assert.assertEquals(Integer.valueOf(1), result); }
107108109110111112113114115116
} @Test(expected=ELException.class) public void testNested03() { ELProcessor processor = new ELProcessor(); // More method parameters than there are nested lambda expressions processor.getValue("(()->y->()->2-y)()(1)()()", Integer.class); }
116117118119120121122123124125126
} @Test public void testNested04() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(()->y->()->x->x-y)()(1)()(2)", Integer.class); Assert.assertEquals(Integer.valueOf(1), result); }
126127128129130131132133134135136
} @Test public void testNested05() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(()->y->()->()->x->x-y)()(1)()()(2)", Integer.class); Assert.assertEquals(Integer.valueOf(1), result); }
136137138139140141142143144145146
} @Test public void testNested06() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("(()->y->()->()->x->x-y)()(1)()(3)(2)", Integer.class); Assert.assertEquals(Integer.valueOf(1), result); }
146147148149150151152153154155156
} @Test public void testNested07() { ELProcessor processor = new ELProcessor(); Object result = processor.getValue("()->()->()->42", Integer.class); Assert.assertEquals(Integer.valueOf(42), result); }