Commit c422c97b authored by Leon Klingele's avatar Leon Klingele Committed by Brad Fitzpatrick

go/printer: add missing error checks in tests

Change-Id: I696da3b07c8b0a2802d3d1291f475e241e4ad90a
GitHub-Last-Rev: df571ce03bd07a1e12203774f4c120f5017590f6
GitHub-Pull-Request: golang/go#30011
Reviewed-on: https://go-review.googlesource.com/c/160435Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 44dc6614
......@@ -153,6 +153,10 @@ func runcheck(t *testing.T, source, golden string, mode checkMode) {
// (This is very difficult to achieve in general and for now
// it is only checked for files explicitly marked as such.)
res, err = format(gld, mode)
if err != nil {
t.Error(err)
return
}
if err := diff(golden, fmt.Sprintf("format(%s)", golden), gld, res); err != nil {
t.Errorf("golden is not idempotent: %s", err)
}
......@@ -744,6 +748,9 @@ func TestParenthesizedDecl(t *testing.T) {
const src = "package p; var ( a float64; b int )"
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "", src, 0)
if err != nil {
t.Fatal(err)
}
// print the original package
var buf bytes.Buffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment