Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Feb 16, 2017
1 parent 03feb2e commit c1e9ab6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions command/data_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ func (p *JSONFormat) TransformData(data interface{}) (string, error) {
err := enc.Encode(data)
if err != nil {
return "", err
} else {
buf.Write([]byte("\n"))
}

return buf.String(), nil
Expand Down
6 changes: 3 additions & 3 deletions command/data_format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type testData struct {
}

const expectJSON = `{
"Region": "global",
"ID": "1",
"Name": "example"
"Name": "example",
"Region": "global"
}`

var (
Expand All @@ -36,7 +36,7 @@ func TestDataFormat(t *testing.T) {
}

if result != expectOutput[k] {
t.Fatalf("expected output: %s, actual: %s", expectOutput[k], result)
t.Fatalf("expected output:\n%s\nactual:\n%s", expectOutput[k], result)
}
}
}
Expand Down

0 comments on commit c1e9ab6

Please sign in to comment.