1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-04-27 13:48:55 +08:00
expvarmon/stack_test.go
2015-04-25 09:07:33 +03:00

24 lines
368 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.Fatalf("len is incorrect. expecting %d, got %d", i, l)
}
} else {
if l != size {
t.Fatalf("len is incorrect. expecting %d, got %d", size, l)
}
}
}
}