1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-04-29 13:49:19 +08:00
expvarmon/stack_test.go
2015-04-25 09:06:45 +03:00

24 lines
366 B
Go

package main
import "testing"
func TestStack(t *testing.T) {
size := 10
s := NewStack(size)
for i := 0; i < size+5; i++ {
s.Push(i)
l := len(s.Values)
if l < size {
if l != i+1 {
t.Fatal("len is incorrect. expecting %d, got %d", i, l)
}
} else {
if l != size {
t.Fatal("len is incorrect. expecting %d, got %d", size, l)
}
}
}
}