MCPcopy Create free account
hub / github.com/facebook/time / TestTakeDataPointOverflow

Function TestTakeDataPointOverflow

fbclock/daemon/state_test.go:68–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66 s.pushDataPoint(dp2)
67 s.pushDataPoint(dp3)
68 s.pushDataPoint(dp4)
69
70 got := s.takeDataPoint(3)
71 require.Len(t, got, 3)
72 require.Equal(t, dp4, got[0])
73 require.Equal(t, dp3, got[1])
74 require.Equal(t, dp2, got[2])
75}
76
77func TestPushAndTakeM(t *testing.T) {
78 s := newDaemonState(3)
79
80 s.pushM(1.5)
81 s.pushM(2.5)
82 s.pushM(3.5)
83
84 got := s.takeM(3)
85 require.Len(t, got, 3)
86 require.Equal(t, 3.5, got[0])
87 require.Equal(t, 2.5, got[1])
88 require.Equal(t, 1.5, got[2])
89}

Callers

nothing calls this directly

Calls 4

newDaemonStateFunction · 0.85
pushDataPointMethod · 0.80
takeDataPointMethod · 0.80
LenMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…