MCPcopy Index your code
hub / github.com/google/go-github / TestFormatRateReset

Function TestFormatRateReset

github/github_test.go:4133–4169  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4131}
4132
4133func TestFormatRateReset(t *testing.T) {
4134 t.Parallel()
4135 d := 120*time.Minute + 12*time.Second
4136 got := formatRateReset(d)
4137 want := "[rate reset in 120m12s]"
4138 if got != want {
4139 t.Errorf("Format is wrong. got: %v, want: %v", got, want)
4140 }
4141
4142 d = 14*time.Minute + 2*time.Second
4143 got = formatRateReset(d)
4144 want = "[rate reset in 14m02s]"
4145 if got != want {
4146 t.Errorf("Format is wrong. got: %v, want: %v", got, want)
4147 }
4148
4149 d = 2*time.Minute + 2*time.Second
4150 got = formatRateReset(d)
4151 want = "[rate reset in 2m02s]"
4152 if got != want {
4153 t.Errorf("Format is wrong. got: %v, want: %v", got, want)
4154 }
4155
4156 d = 12 * time.Second
4157 got = formatRateReset(d)
4158 want = "[rate reset in 12s]"
4159 if got != want {
4160 t.Errorf("Format is wrong. got: %v, want: %v", got, want)
4161 }
4162
4163 d = -1 * (2*time.Hour + 2*time.Second)
4164 got = formatRateReset(d)
4165 want = "[rate limit was reset 120m02s ago]"
4166 if got != want {
4167 t.Errorf("Format is wrong. got: %v, want: %v", got, want)
4168 }
4169}
4170
4171func TestNestedStructAccessorNoPanic(t *testing.T) {
4172 t.Parallel()

Callers

nothing calls this directly

Calls 1

formatRateResetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…