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

Function TestArray

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

Source from the content-addressed store, hash-verified

6)
7
8func TestArray(t *testing.T) {
9 buffer := bytes.NewBuffer(nil)
10 scratch := make([]byte, 64)
11
12 array := newArray(buffer, &scratch)
13 array.Value().String("bar")
14 array.Value().String("baz")
15 array.Close()
16
17 e := []byte(`["bar","baz"]`)
18 if a := buffer.Bytes(); bytes.Compare(e, a) != 0 {
19 t.Errorf("expected %+q, but got %+q", e, a)
20 }
21}

Callers

nothing calls this directly

Calls 6

ErrorfMethod · 0.80
newArrayFunction · 0.70
StringMethod · 0.65
BytesMethod · 0.65
ValueMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected