MCPcopy
hub / github.com/rs/zerolog / TestAppendInt

Function TestAppendInt

internal/json/int_test.go:272–283  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

270}
271
272func TestAppendInt(t *testing.T) {
273 for _, tc := range internal.IntegerTestCases {
274 want := []byte(fmt.Sprintf("%d", tc.Val))
275 got := enc.AppendInt([]byte{}, tc.Val)
276 if !bytes.Equal(got, want) {
277 t.Errorf("AppendInt(0x%x)\ngot: %s\nwant: %s",
278 tc.Val,
279 string(got),
280 string(want))
281 }
282 }
283}
284func TestAppendUint(t *testing.T) {
285 for _, tc := range internal.UnsignedIntegerTestCases {
286 want := []byte(fmt.Sprintf("%d", tc.Val))

Callers

nothing calls this directly

Calls 1

AppendIntMethod · 0.65

Tested by

no test coverage detected