(t *testing.T)
| 339 | } |
| 340 | |
| 341 | func TestEncodeListFlatten(t *testing.T) { |
| 342 | b := bytes.NewBuffer(nil) |
| 343 | encoder := xml.NewEncoder(b) |
| 344 | |
| 345 | func() { |
| 346 | r := encoder.RootElement(root) |
| 347 | defer r.Close() |
| 348 | |
| 349 | // Object key `liststr` |
| 350 | liststr := xml.StartElement{Name: xml.Name{Local: "liststr"}} |
| 351 | m := r.FlattenedElement(liststr) |
| 352 | |
| 353 | a := m.Array() |
| 354 | a.Member().String("abc") |
| 355 | a.Member().Integer(123) |
| 356 | }() |
| 357 | |
| 358 | ex := []byte(`<root><liststr>abc</liststr><liststr>123</liststr></root>`) |
| 359 | verify(t, encoder, ex) |
| 360 | } |
| 361 | |
| 362 | func TestEncodeListNamed(t *testing.T) { |
| 363 | b := bytes.NewBuffer(nil) |
nothing calls this directly
no test coverage detected