diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-27 19:19:13 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-27 19:19:13 -0600 |
commit | 90ca99b744e638b569d8a6bba2cc076c9a419cd2 (patch) | |
tree | 6e73ce4886467f0c508e1477746c74851d10b7ce /src/main/scala/org/perl8/test/tap | |
parent | e669339dc394cfa42ae7d7ccae291328dc64e5d8 (diff) | |
download | scala-test-more-90ca99b744e638b569d8a6bba2cc076c9a419cd2.tar.gz scala-test-more-90ca99b744e638b569d8a6bba2cc076c9a419cd2.zip |
add a leading newline to diags when running under a non-raw reporter
makes things easier to read this way, when diags are printed to stderr
interspersed with test summary information
Diffstat (limited to 'src/main/scala/org/perl8/test/tap')
-rw-r--r-- | src/main/scala/org/perl8/test/tap/TestBuilder.scala | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/scala/org/perl8/test/tap/TestBuilder.scala b/src/main/scala/org/perl8/test/tap/TestBuilder.scala index 39b38c9..9f7e874 100644 --- a/src/main/scala/org/perl8/test/tap/TestBuilder.scala +++ b/src/main/scala/org/perl8/test/tap/TestBuilder.scala @@ -2,14 +2,14 @@ package org.perl8.test.tap import org.perl8.test._ -class TestBuilder (plan: Option[Plan], val indent: String) { +class TestBuilder (plan: Option[Plan], val indent: String, val raw: Boolean) { plan.foreach(p => outLine(Producer.plan(p))) - def this (plan: Plan, indent: String = "") = - this(Some(plan), indent) + def this (plan: Plan, indent: String = "", raw: Boolean = true) = + this(Some(plan), indent, raw) - def this (indent: String = "") = - this(None, indent) + def this (indent: String = "", raw: Boolean = true) = + this(None, indent, raw) def ok ( test: Boolean, @@ -28,7 +28,12 @@ class TestBuilder (plan: Option[Plan], val indent: String) { } def diag (message: Message) { - message.foreach(m => errLine(Producer.comment(m))) + message.foreach { m => + if (!raw) { + Console.err.print("\n") + } + errLine(Producer.comment(m)) + } } def note (message: Message) { |