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

Function TestAppendDurationFloat

internal/cbor/time_test.go:253–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

251}
252
253func TestAppendDurationFloat(t *testing.T) {
254 for _, tt := range internal.DurTestcases {
255 dur := tt.Duration
256 want := []byte{}
257 want = append(want, []byte(tt.FloatOut)...)
258 got := enc.AppendDuration([]byte{}, dur, time.Microsecond, "", false, -1)
259 if !bytes.Equal(got, want) {
260 t.Errorf("AppendDuration(%v)=\ngot: 0x%s\nwant: 0x%s",
261 dur,
262 hex.EncodeToString(got),
263 hex.EncodeToString(want))
264 }
265 }
266}
267func TestAppendDurationInteger(t *testing.T) {
268 for _, tt := range internal.DurTestcases {
269 dur := tt.Duration

Callers

nothing calls this directly

Calls 1

AppendDurationMethod · 0.65

Tested by

no test coverage detected