diff options
author | Julien Dessaux | 2021-09-24 16:45:18 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-24 17:00:06 +0200 |
commit | b3f1792ffa7d25020541cdb48b32551c90277565 (patch) | |
tree | eddb81e31849aeb4a62a03216bfb049f47300700 /pkg/pointer/stack_test.go | |
parent | Renamed project since I do not intend to support over funge variants (diff) | |
download | gofunge98-b3f1792ffa7d25020541cdb48b32551c90277565.tar.gz gofunge98-b3f1792ffa7d25020541cdb48b32551c90277565.tar.bz2 gofunge98-b3f1792ffa7d25020541cdb48b32551c90277565.zip |
Fixed y command, stack and stack stack manipulation bugs
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) { |