Test non-Comparable parameters for Pct and CumPct
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1503629 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
91c5101c33
commit
43e4049d59
|
@ -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()
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue