(t *testing.T)
| 198 | } |
| 199 | |
| 200 | func TestDuration_InRange(t *testing.T) { |
| 201 | cases := []struct { |
| 202 | name string |
| 203 | value time.Duration |
| 204 | min time.Duration |
| 205 | max time.Duration |
| 206 | wantInRange chainResult |
| 207 | wantNotInRange chainResult |
| 208 | }{ |
| 209 | { |
| 210 | name: "value equal to both min and max", |
| 211 | value: time.Second, |
| 212 | min: time.Second, |
| 213 | max: time.Second, |
| 214 | wantInRange: success, |
| 215 | wantNotInRange: failure, |
| 216 | }, |
| 217 | { |
| 218 | name: "value greater than min and equal to max", |
| 219 | value: time.Second, |
| 220 | min: time.Second - 1, |
| 221 | max: time.Second, |
| 222 | wantInRange: success, |
| 223 | wantNotInRange: failure, |
| 224 | }, |
| 225 | { |
| 226 | name: "value equal to min and smaller than max", |
| 227 | value: time.Second, |
| 228 | min: time.Second, |
| 229 | max: time.Second + 1, |
| 230 | wantInRange: success, |
| 231 | wantNotInRange: failure, |
| 232 | }, |
| 233 | { |
| 234 | name: "value smaller than min", |
| 235 | value: time.Second, |
| 236 | min: time.Second + 1, |
| 237 | max: time.Second + 2, |
| 238 | wantInRange: failure, |
| 239 | wantNotInRange: success, |
| 240 | }, |
| 241 | { |
| 242 | name: "value greater than max", |
| 243 | value: time.Second, |
| 244 | min: time.Second - 2, |
| 245 | max: time.Second - 1, |
| 246 | wantInRange: failure, |
| 247 | wantNotInRange: success, |
| 248 | }, |
| 249 | { |
| 250 | name: "min smaller than max", |
| 251 | value: time.Second, |
| 252 | min: time.Second + 1, |
| 253 | max: time.Second - 1, |
| 254 | wantInRange: failure, |
| 255 | wantNotInRange: success, |
| 256 | }, |
| 257 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…