Add gc percent test in lrucache to prevent cheating
This commit is contained in:
parent
52c5558b31
commit
b1863ec9a1
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue