MCPcopy
hub / github.com/nats-io/nats.go / TestDuration

Function TestDuration

bench/benchlib_test.go:45–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestDuration(t *testing.T) {
46 s := millionMessagesSecondSample(1)
47 duration := s.End.Sub(s.Start)
48 if duration != s.Duration() || duration != time.Second {
49 t.Fatal("Expected sample duration to be 1 second")
50 }
51}
52
53func TestSeconds(t *testing.T) {
54 s := millionMessagesSecondSample(1)

Callers

nothing calls this directly

Calls 2

DurationMethod · 0.80

Tested by

no test coverage detected