proyal 2004/05/19 08:22:46
Modified: jexl/src/test/org/apache/commons/jexl JexlTest.java
Log:
Add test for map['size'] and a commented out test that maybe we want to support
map.size as property access
Revision Changes Path
1.36 +12 -1
jakarta-commons/jexl/src/test/org/apache/commons/jexl/JexlTest.java
Index: JexlTest.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jexl/src/test/org/apache/commons/jexl/JexlTest.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- JexlTest.java 28 Feb 2004 13:45:22 -0000 1.35
+++ JexlTest.java 19 May 2004 15:22:45 -0000 1.36
@@ -409,6 +409,17 @@
assertExpression(jc, "list.get(list.size() - 1)", "5");
}
+ public void testSizeAsProperty() throws Exception
+ {
+ JexlContext jc = JexlHelper.createContext();
+
+ jc.getVars().put("map", Collections.singletonMap( "size", "cheese"));
+
+ assertExpression(jc, "map['size']", "cheese");
+// PR - unsure whether or not we should support map.size or force usage of the
above 'escaped' version
+// assertExpression(jc, "map.size", "cheese");
+ }
+
/**
* test some String method calls
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]