Don't depend on a pretty printer just for testing
This commit is contained in:
parent
8ea1e302c3
commit
d82caf6bd4
1
build.sh
1
build.sh
@ -93,7 +93,6 @@ setup() {
|
|||||||
go get -v code.google.com/p/go.tools/cmd/vet
|
go get -v code.google.com/p/go.tools/cmd/vet
|
||||||
go get -v github.com/mattn/goveralls
|
go get -v github.com/mattn/goveralls
|
||||||
go get -v github.com/tools/godep
|
go get -v github.com/tools/godep
|
||||||
GOPATH="$GOPATH:$(godep path)" go get -v -t ./...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr() {
|
xdr() {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ package protocol
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@ -17,7 +18,6 @@ import (
|
|||||||
"testing/quick"
|
"testing/quick"
|
||||||
|
|
||||||
"github.com/calmh/xdr"
|
"github.com/calmh/xdr"
|
||||||
pretty "github.com/tonnerre/golang-pretty"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -346,12 +346,10 @@ func testMarshal(t *testing.T, prefix string, m1, m2 message) bool {
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
|
|
||||||
failed := func(bc []byte) {
|
failed := func(bc []byte) {
|
||||||
f, _ := os.Create(prefix + "-1.txt")
|
bs, _ := json.MarshalIndent(m1, "", " ")
|
||||||
pretty.Fprintf(f, "%# v", m1)
|
ioutil.WriteFile(prefix+"-1.txt", bs, 0644)
|
||||||
f.Close()
|
bs, _ = json.MarshalIndent(m2, "", " ")
|
||||||
f, _ = os.Create(prefix + "-2.txt")
|
ioutil.WriteFile(prefix+"-2.txt", bs, 0644)
|
||||||
pretty.Fprintf(f, "%# v", m2)
|
|
||||||
f.Close()
|
|
||||||
if len(bc) > 0 {
|
if len(bc) > 0 {
|
||||||
f, _ := os.Create(prefix + "-data.txt")
|
f, _ := os.Create(prefix + "-data.txt")
|
||||||
fmt.Fprint(f, hex.Dump(bc))
|
fmt.Fprint(f, hex.Dump(bc))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user