commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r599499 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/FractionTest.java
Date Thu, 29 Nov 2007 16:25:35 GMT
Author: mbenson
Date: Thu Nov 29 08:25:30 2007
New Revision: 599499

URL: http://svn.apache.org/viewvc?rev=599499&view=rev
Log:
[LANG-380] tests

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/FractionTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/FractionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/FractionTest.java?rev=599499&r1=599498&r2=599499&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/FractionTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/FractionTest.java Thu
Nov 29 08:25:30 2007
@@ -642,6 +642,18 @@
         assertEquals(2, result.getNumerator());
         assertEquals(3, result.getDenominator());
         assertSame(f, result);
+
+        f = Fraction.getFraction(0, 1);
+        result = f.reduce();
+        assertEquals(0, result.getNumerator());
+        assertEquals(1, result.getDenominator());
+        assertSame(f, result);
+
+        f = Fraction.getFraction(0, 100);
+        result = f.reduce();
+        assertEquals(0, result.getNumerator());
+        assertEquals(1, result.getDenominator());
+        assertSame(result, Fraction.ZERO);
     }
     
     public void testInvert() {



Mime
View raw message