Skip to content

Commit

Permalink
Fix typos + gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
JyotinderSingh committed Nov 29, 2022
1 parent 653fc2f commit 7578948
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bin/dice
*.aof
.vscode/
2 changes: 1 addition & 1 deletion core/stackint.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *StackInt) Push(x int64) {
}

// Pop Pops an integer from the Stack s.
func (s *StackInt) Remove() (int64, error) {
func (s *StackInt) Pop() (int64, error) {
var val int64
bn := s.list.tail

Expand Down
8 changes: 4 additions & 4 deletions core/stackint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type stackinttcase struct {
}

func TestStackInt(t *testing.T) {
qi := core.NewStackInt()
si := core.NewStackInt()
for _, tc := range []stackinttcase{
{'i', 1, []int64{1}, nil},
{'i', 2, []int64{2, 1}, nil},
Expand Down Expand Up @@ -54,16 +54,16 @@ func TestStackInt(t *testing.T) {
var err error
switch tc.op {
case 'i':
qi.Push(tc.val)
si.Push(tc.val)
case 'r':
_, err = qi.Remove()
_, err = si.Pop()
}

if err != tc.err {
t.Errorf("we expected the error: %v but got %v", tc.err, err)
}

obsList := qi.Iterate(50)
obsList := si.Iterate(50)
if !testutils.EqualInt64Slice(tc.list, obsList) {
t.Errorf("queueint test failed. should have been %v but found %v", tc.list, obsList)
}
Expand Down

0 comments on commit 7578948

Please sign in to comment.