package stack import "testing" func TestInt(t *testing.T) { s := NewStack() s.Push(1) i, _ := s.Pop() if i != 1 { t.Error("Expected 1, got ", i) } } func TestComplex(t *testing.T) { s := NewStack() s.Push(1+1i) i, _ := s.Pop() if i != 1+1i { t.Error("Expected 1+1i, got ", i) } } func TestMeny(t *testing.T) { s := NewStack() s.Push(1) s.Push(2) i, _ := s.Pop() if i != 2 { t.Error("Expected 2, got ", i) } i, _ = s.Pop() if i != 1 { t.Error("Expected 1, got ", i) } } func BenchmarkPushPopSingle(b *testing.B) { s := NewStack() for i := 0; i < b.N; i++ { s.Push(1) s.Pop() } } func BenchmarkPushPopAlot(b *testing.B) { s := NewStack() for i := 0; i < b.N; i++ { s.Push(i) } for i := 0; i < b.N; i++ { s.Pop() } }