(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func TestFlattenedArray(t *testing.T) { |
| 40 | buffer := bytes.NewBuffer(nil) |
| 41 | scratch := make([]byte, 64) |
| 42 | |
| 43 | root := StartElement{Name: Name{Local: "array"}} |
| 44 | a := newArray(buffer, &scratch, arrayMemberWrapper, root, true) |
| 45 | a.Member().String("bar") |
| 46 | a.Member().String("bix") |
| 47 | |
| 48 | e := []byte(`<array>bar</array><array>bix</array>`) |
| 49 | if a := buffer.Bytes(); bytes.Compare(e, a) != 0 { |
| 50 | t.Errorf("expected %+q, but got %+q", e, a) |
| 51 | } |
| 52 | } |