(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestMinQueryTime(t *testing.T) { |
| 11 | tests := []struct { |
| 12 | durationQuerySince time.Duration |
| 13 | timeQueryStart TimeValue |
| 14 | expected time.Time |
| 15 | }{ |
| 16 | { |
| 17 | expected: time.Now(), |
| 18 | }, |
| 19 | { |
| 20 | timeQueryStart: NewTimeValue(time.Unix(1234567890, 0)), |
| 21 | expected: time.Unix(1234567890, 0), |
| 22 | }, |
| 23 | { |
| 24 | durationQuerySince: 10 * time.Hour, |
| 25 | expected: time.Now().Add(-10 * time.Hour), |
| 26 | }, |
| 27 | } |
| 28 | |
| 29 | for _, tt := range tests { |
| 30 | assert.WithinDuration(t, tt.expected, calculateMinQueryTime(tt.durationQuerySince, tt.timeQueryStart), 50*time.Millisecond) |
| 31 | } |
| 32 | } |
nothing calls this directly
no test coverage detected