(t *testing.T)
| 154 | } |
| 155 | |
| 156 | func 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 | |
| 200 | func TestDuration_InRange(t *testing.T) { |
| 201 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…