mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Add a test for formatAndClearCountryStats with binned=true.
This commit is contained in:
parent
bd04cd7752
commit
9946c0f1d8
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,10 @@ func TestFormatAndClearCountryStats(t *testing.T) {
|
||||||
So(formatAndClearCountryStats(stats, false), ShouldEqual, "CN=250,FR=200,RU=150,TZ=100,IT=50,BE=1,CA=1,PH=1")
|
So(formatAndClearCountryStats(stats, false), ShouldEqual, "CN=250,FR=200,RU=150,TZ=100,IT=50,BE=1,CA=1,PH=1")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Convey("the order should be correct with binned=true", func() {
|
||||||
|
So(formatAndClearCountryStats(stats, true), ShouldEqual, "CN=256,FR=200,RU=152,TZ=104,IT=56,BE=8,CA=8,PH=8")
|
||||||
|
})
|
||||||
|
|
||||||
// The map should be cleared on return.
|
// The map should be cleared on return.
|
||||||
stats.Range(func(_, _ any) bool { panic("map was not cleared") })
|
stats.Range(func(_, _ any) bool { panic("map was not cleared") })
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue