jstrachan 02/05/20 03:49:27 Modified: jexl/src/test/org/apache/commons/jexl JexlTest.java Log: Added a new unit test case to demonstrate double array lookups don't quite work yet. e.g. the following expression can't be parsed foo[0][1] Revision Changes Path 1.6 +20 -1 jakarta-commons-sandbox/jexl/src/test/org/apache/commons/jexl/JexlTest.java Index: JexlTest.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jexl/src/test/org/apache/commons/jexl/JexlTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JexlTest.java 17 May 2002 12:22:35 -0000 1.5 +++ JexlTest.java 20 May 2002 10:49:27 -0000 1.6 @@ -71,7 +71,7 @@ * Simple testcases * * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a> - * @version $Id: JexlTest.java,v 1.5 2002/05/17 12:22:35 geirm Exp $ + * @version $Id: JexlTest.java,v 1.6 2002/05/20 10:49:27 jstrachan Exp $ */ public class JexlTest extends TestCase { @@ -514,6 +514,25 @@ o = e.evaluate(jc); assertEquals("o incorrect", Boolean.FALSE, o ); + } + + /** + * test some simple double array lookups + */ + public void testDoubleArrays() + throws Exception + { + Expression e = ExpressionFactory.createExpression("foo[0][1]"); + JexlContext jc = JexlHelper.createContext(); + + Object[][] foo = new Object[2][2]; + foo[0][0] = "one"; + foo[0][1] = "two"; + + jc.getVars().put("foo", foo ); + Object o = e.evaluate(jc); + + assertEquals("o incorrect", "two", o); } public class Foo
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>