From: Leon Klingele Date: Wed, 30 Jan 2019 17:36:22 +0000 (+0000) Subject: go/printer: add missing error checks in tests X-Git-Tag: go1.13beta1~1263 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c422c97b72164d7188c7b2b677ab10dd9a34ae34;p=gostls13.git 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/160435 Reviewed-by: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot --- diff --git a/src/go/printer/printer_test.go b/src/go/printer/printer_test.go index 91eca585c0..a240bf4846 100644 --- a/src/go/printer/printer_test.go +++ b/src/go/printer/printer_test.go @@ -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