diff options
Diffstat (limited to 'pkg/pointer/stack_test.go')
-rw-r--r-- | pkg/pointer/stack_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pkg/pointer/stack_test.go b/pkg/pointer/stack_test.go index 1b16085..35700fd 100644 --- a/pkg/pointer/stack_test.go +++ b/pkg/pointer/stack_test.go @@ -13,16 +13,17 @@ func TestClear(t *testing.T) { } func TestDupicate(t *testing.T) { + expected := NewStack() + expected.height = 2 s := NewStack() - s2 := NewStack() s.Duplicate() - require.Equal(t, s2.height, s.height) + require.Equal(t, expected.height, s.height) s.Push(12) s.Duplicate() - s2.Push(12) - s2.Push(12) - require.Equal(t, s2.height, s.height) - require.Equal(t, s2.data, s.data) + expected.Push(12) + expected.Push(12) + require.Equal(t, expected.height, s.height) + require.Equal(t, expected.data, s.data) } func TestPop(t *testing.T) { |