@@ -32,7 +32,7 @@ func TestLocationStats(t *testing.T) {
32
32
t .Fatal (err )
33
33
}
34
34
35
- want := `{false [{ET Ethiopia 1 <nil>} {ID Indonesia 0 <nil>} ]}`
35
+ want := `{false [{ET Ethiopia 1 <nil>}]}`
36
36
out := fmt .Sprintf ("%v" , stats )
37
37
if want != out {
38
38
t .Errorf ("\n want: %s\n out: %s" , want , out )
@@ -41,12 +41,12 @@ func TestLocationStats(t *testing.T) {
41
41
// Update existing.
42
42
gctest .StoreHits (ctx , t , false , []goatcounter.Hit {
43
43
{Site : site .ID , CreatedAt : now , Location : "ID" },
44
- {Site : site .ID , CreatedAt : now , Location : "ID" },
44
+ {Site : site .ID , CreatedAt : now , Location : "ID" , FirstVisit : true },
45
45
{Site : site .ID , CreatedAt : now , Location : "ET" },
46
46
{Site : site .ID , CreatedAt : now , Location : "ET" , FirstVisit : true },
47
47
{Site : site .ID , CreatedAt : now , Location : "ET" , FirstVisit : true },
48
48
{Site : site .ID , CreatedAt : now , Location : "ET" },
49
- {Site : site .ID , CreatedAt : now , Location : "NZ" },
49
+ {Site : site .ID , CreatedAt : now , Location : "NZ" , FirstVisit : true },
50
50
}... )
51
51
52
52
stats = goatcounter.HitStats {}
@@ -55,7 +55,7 @@ func TestLocationStats(t *testing.T) {
55
55
t .Fatal (err )
56
56
}
57
57
58
- want = `{false [{ET Ethiopia 3 <nil>} {ID Indonesia 0 <nil>} {NZ New Zealand 0 <nil>}]}`
58
+ want = `{false [{ET Ethiopia 3 <nil>} {ID Indonesia 1 <nil>} {NZ New Zealand 1 <nil>}]}`
59
59
out = fmt .Sprintf ("%v" , stats )
60
60
if want != out {
61
61
t .Errorf ("\n want: %s\n out: %s" , want , out )
0 commit comments