diff options
author | Matt Nelson <matt.nelson@cerner.com> | 2017-05-16 17:31:25 -0500 |
---|---|---|
committer | Matt Nelson <matt.nelson@cerner.com> | 2017-05-16 17:31:25 -0500 |
commit | d9caed9db04181c06e7ce02a2750fdfc7f220ecb (patch) | |
tree | cb19f87099c7047c47b04bc09452bf68aa907c99 /org.jacoco.report.test | |
parent | 60b82f23c20c3ce18dad74ea6c3d37233aae4fd7 (diff) | |
download | jacoco-d9caed9db04181c06e7ce02a2750fdfc7f220ecb.tar.gz |
Support limit ratios as percents
Diffstat (limited to 'org.jacoco.report.test')
-rw-r--r-- | org.jacoco.report.test/src/org/jacoco/report/check/LimitTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/org.jacoco.report.test/src/org/jacoco/report/check/LimitTest.java b/org.jacoco.report.test/src/org/jacoco/report/check/LimitTest.java index 7b9405c7..a7add963 100644 --- a/org.jacoco.report.test/src/org/jacoco/report/check/LimitTest.java +++ b/org.jacoco.report.test/src/org/jacoco/report/check/LimitTest.java @@ -262,6 +262,21 @@ public class LimitTest { } @Test + public void testMinPercent() { + limit.setMinimum("1.55%"); + assertEquals("0.0155", limit.getMinimum()); + + limit.setMinimum("1.5%"); + assertEquals("0.015", limit.getMinimum()); + + limit.setMinimum("1.00%"); + assertEquals("0.0100", limit.getMinimum()); + + limit.setMinimum("1%"); + assertEquals("0.01", limit.getMinimum()); + } + + @Test public void testMax0() { limit.setMaximum("0"); limit.setMaximum((String) null); @@ -318,6 +333,21 @@ public class LimitTest { })); } + @Test + public void testMaxPercent() { + limit.setMaximum("1.55%"); + assertEquals("0.0155", limit.getMaximum()); + + limit.setMaximum("1.5%"); + assertEquals("0.015", limit.getMaximum()); + + limit.setMaximum("1.00%"); + assertEquals("0.0100", limit.getMaximum()); + + limit.setMaximum("1%"); + assertEquals("0.01", limit.getMaximum()); + } + private static class TestNode extends CoverageNodeImpl { public TestNode() { |