(t *testing.T)
| 468 | } |
| 469 | |
| 470 | func TestWithinDurationWrapper(t *testing.T) { |
| 471 | t.Parallel() |
| 472 | |
| 473 | assert := New(t) |
| 474 | mockAssert := New(new(testing.T)) |
| 475 | a := time.Now() |
| 476 | b := a.Add(10 * time.Second) |
| 477 | |
| 478 | assert.True(mockAssert.WithinDuration(a, b, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 479 | assert.True(mockAssert.WithinDuration(b, a, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 480 | |
| 481 | assert.False(mockAssert.WithinDuration(a, b, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 482 | assert.False(mockAssert.WithinDuration(b, a, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 483 | |
| 484 | assert.False(mockAssert.WithinDuration(a, b, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 485 | assert.False(mockAssert.WithinDuration(b, a, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 486 | |
| 487 | assert.False(mockAssert.WithinDuration(a, b, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 488 | assert.False(mockAssert.WithinDuration(b, a, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 489 | } |
| 490 | |
| 491 | func TestInDeltaWrapper(t *testing.T) { |
| 492 | t.Parallel() |
nothing calls this directly
no test coverage detected