From 05e14bcf1b12be9b2500288d067cd473d50280d1 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 28 Feb 2013 18:38:15 -0600 Subject: this extra conditional isn't necessary --- .../scala/org/perl8/test/tap/TestBuilder.scala | 38 ++++++++++------------ 1 file 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 -- cgit v1.2.3-54-g00ecf