commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1503629 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
Date Tue, 16 Jul 2013 09:34:38 GMT
Author: sebb
Date: Tue Jul 16 09:34:38 2013
New Revision: 1503629

URL: http://svn.apache.org/r1503629
Log:
Test non-Comparable parameters for Pct and CumPct

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java?rev=1503629&r1=1503628&r2=1503629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
Tue Jul 16 09:34:38 2013
@@ -199,6 +199,20 @@ public final class FrequencyTest {
         Assert.assertTrue("cum pct, empty table", Double.isNaN(f.getCumPct(Integer.valueOf(0))));
     }
 
+    @Test
+    public void testNonComparableCumPct() {
+        f.addValue("a");
+        Assert.assertEquals("cum freq, single entry", 1.0d, f.getCumPct("a"),TOLERANCE);
+        Assert.assertEquals("cum freq, single entry non comparable", 0.0d, f.getCumPct(100),TOLERANCE);
+    }
+
+    @Test
+    public void testNonComparablePct() {
+        f.addValue("a");
+        Assert.assertEquals("cum freq, single entry", 1.0d, f.getPct("a"),TOLERANCE);
+        Assert.assertEquals("cum freq, single entry non comparable", 0.0d, f.getPct(100),TOLERANCE);
+    }
+
     /**
      * Tests toString()
      */



Mime
View raw message