aboutsummaryrefslogtreecommitdiff
path: root/pkg/stack/stack_test.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkg/stack/stack_test.go (renamed from pkg/pointer/stack_test.go)24
1 files changed, 16 insertions, 8 deletions
diff --git a/pkg/pointer/stack_test.go b/pkg/stack/stack_test.go
index 35700fd..2f15d3a 100644
--- a/pkg/pointer/stack_test.go
+++ b/pkg/stack/stack_test.go
@@ -1,4 +1,4 @@
-package pointer
+package stack
import (
"testing"
@@ -7,15 +7,15 @@ import (
)
func TestClear(t *testing.T) {
- s := NewStack()
+ s := NewStack(32, nil)
s.Clear()
require.Equal(t, 0, s.height)
}
func TestDupicate(t *testing.T) {
- expected := NewStack()
+ expected := NewStack(32, nil)
expected.height = 2
- s := NewStack()
+ s := NewStack(32, nil)
s.Duplicate()
require.Equal(t, expected.height, s.height)
s.Push(12)
@@ -27,7 +27,7 @@ func TestDupicate(t *testing.T) {
}
func TestPop(t *testing.T) {
- s := NewStack()
+ s := NewStack(32, nil)
v := s.Pop()
require.Equal(t, 0, v)
s.Push(12)
@@ -41,7 +41,7 @@ func TestPop(t *testing.T) {
}
func TestPush(t *testing.T) {
- s := NewStack()
+ s := NewStack(32, nil)
for i := 0; i < 32; i++ {
s.Push(i)
}
@@ -51,8 +51,8 @@ func TestPush(t *testing.T) {
}
func TestSwap(t *testing.T) {
- s := NewStack()
- s2 := NewStack()
+ s := NewStack(32, nil)
+ s2 := NewStack(32, nil)
s.Swap()
s2.Push(0)
s2.Push(0)
@@ -73,3 +73,11 @@ func TestSwap(t *testing.T) {
s.Swap()
require.Equal(t, s2, s)
}
+
+func TestHeights(t *testing.T) {
+ // TODO
+}
+
+func TestTransfert(t *testing.T) {
+ // TODO
+}