commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1135788 - /commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/IssuesTest.java
Date Tue, 14 Jun 2011 20:51:24 GMT
Author: sebb
Date: Tue Jun 14 20:51:23 2011
New Revision: 1135788

URL: http://svn.apache.org/viewvc?rev=1135788&view=rev
Log:
Add tests for octal and hex numbers

Modified:
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/IssuesTest.java

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/IssuesTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/IssuesTest.java?rev=1135788&r1=1135787&r2=1135788&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/IssuesTest.java (original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/IssuesTest.java Tue Jun
14 20:51:23 2011
@@ -41,7 +41,7 @@ public class IssuesTest extends JexlTest
     public void test24() throws Exception {
         Map<String, Object> vars = new HashMap<String, Object>();
         JexlContext ctxt = new MapContext(vars);
-        String stmt = "{a = 10L; b = 10l; c = 42.0D; d = 42.0d; e=56.3F; f=56.3f; g=63.5}";
+        String stmt = "{a = 10L; b = 10l; c = 42.0D; d = 42.0d; e=56.3F; f=56.3f; g=63.5;
h=0x10; i=010; j=0x10L; k=010l}";
         Script expr = JEXL.createScript(stmt);
         /* Object value = */ expr.execute(ctxt);
         assertEquals(10L, vars.get("a"));
@@ -51,6 +51,10 @@ public class IssuesTest extends JexlTest
         assertEquals(56.3f, vars.get("e"));
         assertEquals(56.3f, vars.get("f"));
         assertEquals(63.5f, vars.get("g"));
+        assertEquals(0x10, vars.get("h"));
+        assertEquals(010, vars.get("i"));
+        assertEquals(0x10L, vars.get("j"));
+        assertEquals(010l, vars.get("k"));
     }
 
     // JEXL-24: big integers and big decimals



Mime
View raw message