diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-28 18:38:15 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-28 18:38:15 -0600 |
commit | 05e14bcf1b12be9b2500288d067cd473d50280d1 (patch) | |
tree | dcd3116b9245ca4da5f30f9cf59628c960522cdc | |
parent | 7d137614256e354fd06f8883e75f263c7f3ccb9e (diff) | |
download | scala-test-more-05e14bcf1b12be9b2500288d067cd473d50280d1.tar.gz scala-test-more-05e14bcf1b12be9b2500288d067cd473d50280d1.zip |
this extra conditional isn't necessary
-rw-r--r-- | src/main/scala/org/perl8/test/tap/TestBuilder.scala | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/main/scala/org/perl8/test/tap/TestBuilder.scala b/src/main/scala/org/perl8/test/tap/TestBuilder.scala index 99465fd..4ccd396 100644 --- a/src/main/scala/org/perl8/test/tap/TestBuilder.scala +++ b/src/main/scala/org/perl8/test/tap/TestBuilder.scala @@ -74,28 +74,26 @@ class TestBuilder private ( case _ => () } - if (!state.isPassing) { - if (!state.matchesPlan) { - val planCount = (plan match { - case NoPlan => state.currentTest - case p => p.plan - }) - val planned = planCount + " test" + (if (planCount > 1) "s" else "") - val ran = state.currentTest - diag("Looks like you planned " + planned + " but ran " + ran + ".") - } + if (!state.matchesPlan) { + val planCount = (plan match { + case NoPlan => state.currentTest + case p => p.plan + }) + val planned = planCount + " test" + (if (planCount > 1) "s" else "") + val ran = state.currentTest + diag("Looks like you planned " + planned + " but ran " + ran + ".") + } - if (state.currentTest == 0) { - diag("No tests run!") - } + if (state.currentTest == 0) { + diag("No tests run!") + } - if (state.failCount > 0) { - val count = state.failCount - val fails = count + " test" + (if (count > 1) "s" else "") - val total = - state.currentTest + (if (state.matchesPlan) "" else " run") - diag("Looks like you failed " + fails + " of " + total + ".") - } + if (state.failCount > 0) { + val count = state.failCount + val fails = count + " test" + (if (count > 1) "s" else "") + val total = + state.currentTest + (if (state.matchesPlan) "" else " run") + diag("Looks like you failed " + fails + " of " + total + ".") } state.isPassing |