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

Function TestWrappedArray

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

Source from the content-addressed store, hash-verified

6)
7
8func TestWrappedArray(t *testing.T) {
9 buffer := bytes.NewBuffer(nil)
10 scratch := make([]byte, 64)
11
12 root := StartElement{Name: Name{Local: "array"}}
13 a := newArray(buffer, &scratch, arrayMemberWrapper, root, false)
14 a.Member().String("bar")
15 a.Member().String("baz")
16
17 e := []byte(`<member>bar</member><member>baz</member>`)
18 if a := buffer.Bytes(); bytes.Compare(e, a) != 0 {
19 t.Errorf("expected %+q, but got %+q", e, a)
20 }
21}
22
23func TestWrappedArrayWithCustomName(t *testing.T) {
24 buffer := bytes.NewBuffer(nil)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected