(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func TestEncodeAttribute(t *testing.T) { |
| 42 | b := bytes.NewBuffer(nil) |
| 43 | encoder := xml.NewEncoder(b) |
| 44 | |
| 45 | func() { |
| 46 | r := xml.StartElement{ |
| 47 | Name: xml.Name{Local: "payload", Space: "baz"}, |
| 48 | Attr: []xml.Attr{ |
| 49 | xml.NewAttribute("attrkey", "value"), |
| 50 | }, |
| 51 | } |
| 52 | |
| 53 | obj := encoder.RootElement(r) |
| 54 | obj.String("") |
| 55 | }() |
| 56 | |
| 57 | expect := `<baz:payload attrkey="value"></baz:payload>` |
| 58 | |
| 59 | verify(t, encoder, []byte(expect)) |
| 60 | } |
| 61 | |
| 62 | func TestEncodeNamespace(t *testing.T) { |
| 63 | b := bytes.NewBuffer(nil) |
nothing calls this directly
no test coverage detected