aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/testing/example.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-01-13 05:11:45 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-01-13 05:11:45 +0000
commitdf4aa89a5e7acb315655f193e7f549e8d32367e2 (patch)
treeeb5eccc07097c5fcf940967f33ab84a7d47c96fe /libgo/go/testing/example.go
parentf83fa0bf8f411697ec908cfa86ee6faf4cd9c476 (diff)
downloadgcc-df4aa89a5e7acb315655f193e7f549e8d32367e2.zip
gcc-df4aa89a5e7acb315655f193e7f549e8d32367e2.tar.gz
gcc-df4aa89a5e7acb315655f193e7f549e8d32367e2.tar.bz2
libgo: Update to weekly.2011-12-22.
From-SVN: r183150
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 e23f13b..fdeda13 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)