(t *testing.T)
| 65 | } |
| 66 | |
| 67 | func TestStatsTracker_GetUsersStats(t *testing.T) { |
| 68 | tracker := New() |
| 69 | ctx := context.Background() |
| 70 | |
| 71 | updateSample(tracker, "key1", "user1@example.com", 1000, 2000, "1.2.3.4") |
| 72 | updateSample(tracker, "key2", "user2@example.com", 3000, 4000, "1.2.3.5") |
| 73 | |
| 74 | resp := tracker.GetUsersStats(ctx, false) |
| 75 | if len(resp.Stats) != 4 { |
| 76 | t.Fatalf("Expected 4 stats, got %d", len(resp.Stats)) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func TestStatsTracker_RemoveStatsMarksDeletedAndKeepsDeltaUntilReset(t *testing.T) { |
| 81 | tracker := New() |
nothing calls this directly
no test coverage detected