aboutsummaryrefslogtreecommitdiffstats
path: root/marshall_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'marshall_test.go')
-rw-r--r--marshall_test.go25
1 files changed, 22 insertions, 3 deletions
diff --git a/marshall_test.go b/marshall_test.go
index bb57cfd..a916556 100644
--- a/marshall_test.go
+++ b/marshall_test.go
@@ -28,6 +28,27 @@ func TestMarshallXML(t *testing.T) {
os.Stdout.Write(output)
}
+func TestMarshallXMLToken(t *testing.T) {
+ token := Token{Val: randomToken(16)}
+ response := LFMResponse{Status: "ok",
+ Response: token}
+ output, err := xml.MarshalIndent(response, " ", " ")
+ if err != nil {
+ fmt.Printf("error: %v\n", err)
+ }
+ fmt.Printf(xml.Header)
+ os.Stdout.Write(output)
+}
+
+func TestMarshallJSONToken(t *testing.T) {
+ token := Token{Val: randomToken(16)}
+ output, err := json.MarshalIndent(token, " ", " ")
+ if err != nil {
+ fmt.Printf("error: %v\n", err)
+ }
+ os.Stdout.Write(output)
+}
+
func TestMarshallJSON(t *testing.T) {
s := []Scrobble{
Scrobble{Artist: Correctable{Name: "Mumford & Sons"},
@@ -37,9 +58,7 @@ func TestMarshallJSON(t *testing.T) {
}
scrobbles := Scrobbles{Scrobbles: s,
Attrs: Attrs{1, 0}}
- response := LFMResponse{Status: "ok",
- Response: scrobbles}
- output, err := json.MarshalIndent(response, " ", " ")
+ output, err := json.MarshalIndent(scrobbles, " ", " ")
if err != nil {
fmt.Printf("error: %v\n", err)
}