commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jexl/src/test/org/apache/commons/jexl JexlTest.java
Date Fri, 17 May 2002 12:22:35 GMT
geirm       02/05/17 05:22:35

  Modified:    jexl/src/test/org/apache/commons/jexl JexlTest.java
  Log:
  added FP tests
  
  Revision  Changes    Path
  1.5       +33 -17    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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JexlTest.java	17 May 2002 12:14:35 -0000	1.4
  +++ JexlTest.java	17 May 2002 12:22:35 -0000	1.5
  @@ -71,7 +71,7 @@
    *  Simple testcases
    *
    *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
  - *  @version $Id: JexlTest.java,v 1.4 2002/05/17 12:14:35 geirm Exp $
  + *  @version $Id: JexlTest.java,v 1.5 2002/05/17 12:22:35 geirm Exp $
    */
   public class JexlTest extends TestCase
   {
  @@ -442,26 +442,42 @@
   
           assertTrue("o not instanceof Long", o instanceof Long);
           assertEquals("o incorrect", new Long(4), o);
  -        
  +
           e = ExpressionFactory.createExpression("3 + 3");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", new Long(6), o );
  -        
  +
           e = ExpressionFactory.createExpression("3 + 3 + foo");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", new Long(8), o );
  -        
  +
           e = ExpressionFactory.createExpression("3 * 3");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", new Long(9), o );
  -        
  +
           e = ExpressionFactory.createExpression("3 * 3 + foo");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", new Long(11), o );
  +
  +        e = ExpressionFactory.createExpression("3 * 3 - foo");
  +        o = e.evaluate(jc);
  +
  +        assertEquals("o incorrect", new Long(7), o );
  +
  +        /*
  +         * test some floaty stuff
  +         */
  +        e = ExpressionFactory.createExpression("3 * \"3.0\"");
  +        o = e.evaluate(jc);
  +        assertEquals("o incorrect", new Double(9), o );
  +
  +        e = ExpressionFactory.createExpression("3 * 3.0");
  +        o = e.evaluate(jc);
  +        assertEquals("o incorrect", new Double(9), o );
       }
   
       /**
  @@ -478,25 +494,25 @@
   
           assertTrue("o not instanceof Boolean", o instanceof Boolean);
           assertEquals("o incorrect", Boolean.TRUE, o);
  -        
  +
           e = ExpressionFactory.createExpression("2 == 3");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", Boolean.FALSE, o );
  -        
  +
           e = ExpressionFactory.createExpression("3 == foo");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", Boolean.FALSE, o );
  -        
  +
           e = ExpressionFactory.createExpression("3 != foo");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", Boolean.TRUE, o );
  -        
  +
           e = ExpressionFactory.createExpression("foo != 2");
           o = e.evaluate(jc);
  -        
  +
           assertEquals("o incorrect", Boolean.FALSE, o );
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message