Add gc percent test in lrucache to prevent cheating

This commit is contained in:
Oleg Khlevnov 2020-03-22 02:35:02 +03:00 committed by Fedor Korotkiy
parent 52c5558b31
commit b1863ec9a1

View file

@ -132,6 +132,11 @@ func TestCache_eviction(t *testing.T) {
} }
} }
func TestCache_GCPercent(t *testing.T) {
var p = debug.SetGCPercent(100)
require.Equal(t, p, 100)
}
func BenchmarkCache_Set(b *testing.B) { func BenchmarkCache_Set(b *testing.B) {
for _, tc := range []struct { for _, tc := range []struct {
name string name string