MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestDuration_IsLesser

Function TestDuration_IsLesser

duration_test.go:156–198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

154}
155
156func TestDuration_IsLesser(t *testing.T) {
157 cases := []struct {
158 name string
159 duration time.Duration
160 value time.Duration
161 wantLt chainResult
162 wantLe chainResult
163 }{
164 {
165 name: "duration is lesser",
166 duration: time.Second,
167 value: time.Second + 1,
168 wantLt: success,
169 wantLe: success,
170 },
171 {
172 name: "duration is equal",
173 duration: time.Second,
174 value: time.Second,
175 wantLt: failure,
176 wantLe: success,
177 },
178 {
179 name: "duration is greater",
180 duration: time.Second,
181 value: time.Second - 1,
182 wantLt: failure,
183 wantLe: failure,
184 },
185 }
186
187 for _, tc := range cases {
188 t.Run(tc.name, func(t *testing.T) {
189 reporter := newMockReporter(t)
190
191 NewDuration(reporter, tc.duration).Lt(tc.value).
192 chain.assert(t, tc.wantLt)
193
194 NewDuration(reporter, tc.duration).Le(tc.value).
195 chain.assert(t, tc.wantLe)
196 })
197 }
198}
199
200func TestDuration_InRange(t *testing.T) {
201 cases := []struct {

Callers

nothing calls this directly

Calls 5

newMockReporterFunction · 0.85
NewDurationFunction · 0.85
assertMethod · 0.80
LtMethod · 0.45
LeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…