diff options
Diffstat (limited to 'marshall_test.go')
| -rw-r--r-- | marshall_test.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/marshall_test.go b/marshall_test.go index b5e9fae..ad4d6fd 100644 --- a/marshall_test.go +++ b/marshall_test.go @@ -15,13 +15,15 @@ func TestMarshallXML(t *testing.T) { Time: 1479682785, Album: Correctable{Name: "Mellow Gold"}}, } - fmt.Printf("%v\n", s) scrobbles := Scrobbles{Scrobbles: s, Attrs: Attrs{1, 0}} - output, err := xml.MarshalIndent(scrobbles, " ", " ") + response := LFMResponse{Status: "ok", + Response: scrobbles} + output, err := xml.MarshalIndent(response, " ", " ") if err != nil { fmt.Printf("error: %v\n", err) } + fmt.Printf(xml.Header) os.Stdout.Write(output) } @@ -34,8 +36,9 @@ func TestMarshallJSON(t *testing.T) { } scrobbles := Scrobbles{Scrobbles: s, Attrs: Attrs{1, 0}} - jsonscrobble := map[string]Scrobbles{"scrobbles": scrobbles} - output, err := json.MarshalIndent(jsonscrobble, " ", " ") + response := LFMResponse{Status: "ok", + Response: scrobbles} + output, err := json.MarshalIndent(response, " ", " ") if err != nil { fmt.Printf("error: %v\n", err) } |
