1
0
mirror of https://github.com/golang/go synced 2024-10-01 04:18:33 -06:00

go.tools/imports: fix test broken in b33d2e25015b6793aac4f9dcef3d8a8d1c9243b3

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/41950048
This commit is contained in:
David Crawshaw 2013-12-18 03:44:50 -08:00 committed by Brad Fitzpatrick
parent c87866116c
commit 64c6d0410b

View File

@ -5,13 +5,11 @@
package imports package imports
import ( import (
"bytes"
"flag" "flag"
"go/build" "go/build"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings"
"testing" "testing"
) )
@ -472,13 +470,12 @@ func TestFixImports(t *testing.T) {
if *only != "" && tt.name != *only { if *only != "" && tt.name != *only {
continue continue
} }
var buf bytes.Buffer buf, err := Process("foo.go", []byte(tt.in), nil)
err := processFile("foo.go", strings.NewReader(tt.in), &buf, false)
if err != nil { if err != nil {
t.Errorf("error on %q: %v", tt.name, err) t.Errorf("error on %q: %v", tt.name, err)
continue continue
} }
if got := buf.String(); got != tt.out { if got := string(buf); got != tt.out {
t.Errorf("results diff on %q\nGOT:\n%s\nWANT:\n%s\n", tt.name, got, tt.out) t.Errorf("results diff on %q\nGOT:\n%s\nWANT:\n%s\n", tt.name, got, tt.out)
} }
} }