奇怪的错误

This commit is contained in:
huangsimin
2019-04-03 18:24:05 +08:00
parent f0f16d7516
commit 3d1be547ca
2 changed files with 10 additions and 3 deletions

View File

@@ -25,16 +25,19 @@ func TestPush(t *testing.T) {
t.Error(s.String(), " size ", s.size)
}
var l []int
for i := 0; i < 10; i++ {
v := randomdata.Number(0, 10)
s.Push(v)
l = append(l, v)
}
for i := -1; i < 11; i++ {
v, ok := s.Get(i)
t.Error(v, ok)
}
t.Error(l)
}
func BenchmarkGet(b *testing.B) {