summaryrefslogtreecommitdiff
path: root/stack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'stack_test.go')
-rw-r--r--stack_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/stack_test.go b/stack_test.go
index bdb5c0e..32637fa 100644
--- a/stack_test.go
+++ b/stack_test.go
@@ -3,7 +3,7 @@ package stack
import "testing"
func TestInt(t *testing.T) {
- s := NewStack()
+ s := New()
s.Push(1)
i := s.Pop()
if i != 1 {
@@ -12,16 +12,16 @@ func TestInt(t *testing.T) {
}
func TestComplex(t *testing.T) {
- s := NewStack()
- s.Push(1+1i)
+ s := New()
+ 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()
+func TestMany(t *testing.T) {
+ s := New()
s.Push(1)
s.Push(2)
i := s.Pop()
@@ -35,7 +35,7 @@ func TestMeny(t *testing.T) {
}
func TestSwap(t *testing.T) {
- s := NewStack()
+ s := New()
s.Push(1)
s.Push(2)
s.Swap()
@@ -53,7 +53,7 @@ func TestSwap(t *testing.T) {
}
func TestInsert(t *testing.T) {
- s := NewStack()
+ s := New()
s.Push(1)
s.Insert(2)
if s.Depth() != 2 {
@@ -70,7 +70,7 @@ func TestInsert(t *testing.T) {
}
func BenchmarkPushPopSingle(b *testing.B) {
- s := NewStack()
+ s := New()
for i := 0; i < b.N; i++ {
s.Push(1)
s.Pop()
@@ -78,7 +78,7 @@ func BenchmarkPushPopSingle(b *testing.B) {
}
func BenchmarkPushPopAlot(b *testing.B) {
- s := NewStack()
+ s := New()
for i := 0; i < b.N; i++ {
s.Push(i)
}
@@ -88,7 +88,7 @@ func BenchmarkPushPopAlot(b *testing.B) {
}
func BenchmarkInsetPopSingle(b *testing.B) {
- s := NewStack()
+ s := New()
for i := 0; i < b.N; i++ {
s.Insert(1)
s.Pop()
@@ -96,7 +96,7 @@ func BenchmarkInsetPopSingle(b *testing.B) {
}
func BenchmarkInsetPopAlot(b *testing.B) {
- s := NewStack()
+ s := New()
for i := 0; i < b.N; i++ {
s.Insert(i)
}