MCPcopy Create free account
hub / github.com/prometheus/common / TestDurationMilliseconds

Function TestDurationMilliseconds

model/time_test.go:86–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestDurationMilliseconds(t *testing.T) {
87 d := 2*Hour + 30*Minute + 15*Second + 250*Millisecond
88 require.Equal(t, time.Duration(d).Milliseconds(), d.Milliseconds())
89 require.Equal(t, int64(2*60*60*1000+30*60*1000+15*1000+250), d.Milliseconds())
90 require.Equal(t, int64(-1500), (-1500 * Millisecond).Milliseconds())
91}
92
93func TestParseDuration(t *testing.T) {
94 type testCase struct {

Callers

nothing calls this directly

Calls 2

MillisecondsMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected