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

Function TestFlattenedArray

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

Source from the content-addressed store, hash-verified

37}
38
39func 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}

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