MCPcopy Create free account
hub / github.com/aws/smithy-go / TestWrappedArrayWithCustomName

Function TestWrappedArrayWithCustomName

encoding/xml/array_test.go:23–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestWrappedArrayWithCustomName(t *testing.T) {
24 buffer := bytes.NewBuffer(nil)
25 scratch := make([]byte, 64)
26
27 root := StartElement{Name: Name{Local: "array"}}
28 item := StartElement{Name: Name{Local: "item"}}
29 a := newArray(buffer, &scratch, item, root, false)
30 a.Member().String("bar")
31 a.Member().String("baz")
32
33 e := []byte(`<item>bar</item><item>baz</item>`)
34 if a := buffer.Bytes(); bytes.Compare(e, a) != 0 {
35 t.Errorf("expected %+q, but got %+q", e, a)
36 }
37}
38
39func TestFlattenedArray(t *testing.T) {
40 buffer := bytes.NewBuffer(nil)

Callers

nothing calls this directly

Calls 5

MemberMethod · 0.80
ErrorfMethod · 0.80
newArrayFunction · 0.70
StringMethod · 0.65
BytesMethod · 0.65

Tested by

no test coverage detected