summaryrefslogtreecommitdiffstats
path: root/libgo/go/testing/example.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/testing/example.go')
-rw-r--r--libgo/go/testing/example.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/libgo/go/testing/example.go b/libgo/go/testing/example.go
index e23f13b6f16..fdeda137e76 100644
--- a/libgo/go/testing/example.go
+++ b/libgo/go/testing/example.go
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"os"
+ "strings"
"time"
)
@@ -67,11 +68,9 @@ func RunExamples(examples []InternalExample) (ok bool) {
// report any errors
tstr := fmt.Sprintf("(%.2f seconds)", dt.Seconds())
- if out != eg.Output {
- fmt.Printf(
- "--- FAIL: %s %s\ngot:\n%s\nwant:\n%s\n",
- eg.Name, tstr, out, eg.Output,
- )
+ if g, e := strings.TrimSpace(out), strings.TrimSpace(eg.Output); g != e {
+ fmt.Printf("--- FAIL: %s %s\ngot:\n%s\nwant:\n%s\n",
+ eg.Name, tstr, g, e)
ok = false
} else if *chatty {
fmt.Printf("--- PASS: %s %s\n", eg.Name, tstr)
OpenPOWER on IntegriCloud