1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07: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
import (
"bytes"
"flag"
"go/build"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
)
@ -472,13 +470,12 @@ func TestFixImports(t *testing.T) {
if *only != "" && tt.name != *only {
continue
}
var buf bytes.Buffer
err := processFile("foo.go", strings.NewReader(tt.in), &buf, false)
buf, err := Process("foo.go", []byte(tt.in), nil)
if err != nil {
t.Errorf("error on %q: %v", tt.name, err)
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)
}
}