summaryrefslogtreecommitdiff
path: root/cmd/planr/sub/cli.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/planr/sub/cli.go')
-rw-r--r--cmd/planr/sub/cli.go34
1 files changed, 32 insertions, 2 deletions
diff --git a/cmd/planr/sub/cli.go b/cmd/planr/sub/cli.go
index 42d1c81..2bcaed9 100644
--- a/cmd/planr/sub/cli.go
+++ b/cmd/planr/sub/cli.go
@@ -42,6 +42,34 @@ func pprintLabeled(label, value string) {
fmt.Println(value)
}
+const (
+ FENCE_WIDTH = 80
+)
+
+func pprintFenced(title, value string) {
+ wingWidth := FENCE_WIDTH - len(title) - 2
+
+ for i := 0; i < wingWidth / 2; i++ {
+ fmt.Print("-")
+ }
+
+ fmt.Printf(" %s ", title)
+
+ for i := 0; i < wingWidth / 2; i++ {
+ fmt.Print("-")
+ }
+
+ fmt.Println()
+
+ fmt.Print(value)
+
+ for i := 0; i < FENCE_WIDTH; i++ {
+ fmt.Print("-")
+ }
+
+ fmt.Println()
+}
+
func tcStatusLine(tc planr.TestCase) {
title := tcTitle(tc)
status := tcStatus(tc)
@@ -68,11 +96,13 @@ func tcPprint(tc planr.TestCase) {
}
if tc.Result.DebugOutput != "" {
- pprintLabeled("debug output", tc.Result.DebugOutput)
+ fmt.Println()
+ pprintFenced("compilation output", tc.Result.DebugOutput);
}
if tc.Result.FailureMsg != "" {
- pprintLabeled("failure", tc.Result.FailureMsg);
+ fmt.Println()
+ pprintFenced("test output", tc.Result.FailureMsg);
}
fmt.Println()