67 assertMarshal(t, exp, s) |
67 assertMarshal(t, exp, s) |
68 } |
68 } |
69 |
69 |
70 func TestStreamErrorMarshal(t *testing.T) { |
70 func TestStreamErrorMarshal(t *testing.T) { |
71 name := xml.Name{Space: nsStreams, Local: "ack"} |
71 name := xml.Name{Space: nsStreams, Local: "ack"} |
72 e := &StreamError{Any: definedCondition{XMLName: name}} |
72 e := &StreamError{Any: Generic{XMLName: name}} |
73 exp := `<stream:error><ack xmlns="` + nsStreams + |
73 exp := `<stream:error><ack xmlns="` + nsStreams + |
74 `"></ack></stream:error>`; |
74 `"></ack></stream:error>`; |
75 assertMarshal(t, exp, e) |
75 assertMarshal(t, exp, e) |
76 |
76 |
77 txt := errText{Lang: "pt", Text: "things happen"} |
77 txt := errText{Lang: "pt", Text: "things happen"} |
78 e = &StreamError{Any: definedCondition{XMLName: name}, Text: &txt} |
78 e = &StreamError{Any: Generic{XMLName: name}, Text: &txt} |
79 exp = `<stream:error><ack xmlns="` + nsStreams + |
79 exp = `<stream:error><ack xmlns="` + nsStreams + |
80 `"></ack><text xmlns="` + nsStreams + |
80 `"></ack><text xmlns="` + nsStreams + |
81 `" xml:lang="pt">things happen</text></stream:error>` |
81 `" xml:lang="pt">things happen</text></stream:error>` |
82 assertMarshal(t, exp, e) |
82 assertMarshal(t, exp, e) |
83 } |
83 } |