From b3f1792ffa7d25020541cdb48b32551c90277565 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 24 Sep 2021 16:45:18 +0200 Subject: Fixed y command, stack and stack stack manipulation bugs --- pkg/pointer/stack_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'pkg/pointer/stack_test.go') 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) { -- cgit v1.2.3