(t *testing.T)
| 222 | } |
| 223 | |
| 224 | func TestStatsTracker_AnyActiveSince(t *testing.T) { |
| 225 | tracker := New() |
| 226 | |
| 227 | updateSample(tracker, "key1", "user@example.com", 100, 0, "1.2.3.4") |
| 228 | |
| 229 | if !tracker.AnyActiveSince([]string{"key1"}, time.Now().Add(-time.Hour)) { |
| 230 | t.Fatal("expected key to be active for old cutoff") |
| 231 | } |
| 232 | |
| 233 | if tracker.AnyActiveSince([]string{"key1"}, time.Now().Add(time.Hour)) { |
| 234 | t.Fatal("did not expect key to be active for future cutoff") |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | func TestStatsTracker_EndpointActivityReturnsNewestPerIP(t *testing.T) { |
| 239 | tracker := New() |
nothing calls this directly
no test coverage detected