Skip to content

Commit

Permalink
chore: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Jul 16, 2024
1 parent 7455b90 commit 010ebed
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,24 @@ func TestAdd(t *testing.T) {

// Push some elements to the stack.
// The stack should be equal to [0x1, 0x2, 0x3].
evm.stack.Push(uint256.NewInt(1))
evm.stack.Push(uint256.NewInt(2))
evm.stack.Push(uint256.NewInt(3))
err := evm.stack.Push(uint256.NewInt(1))
if err != nil {
t.Errorf("Push() returned an unexpected error: %v", err)
}

err = evm.stack.Push(uint256.NewInt(2))
if err != nil {
t.Errorf("Push() returned an unexpected error: %v", err)
}

err = evm.stack.Push(uint256.NewInt(3))
if err != nil {
t.Errorf("Push() returned an unexpected error: %v", err)
}

// Add the two elements at the top of the stack.
// The stack should be equal to [0x1, 0x5].
err := evm.Add()
err = evm.Add()
if err != nil {
t.Errorf("Add() returned an unexpected error: %v", err)
}
Expand Down Expand Up @@ -58,10 +69,13 @@ func TestAddOnOneElementStack(t *testing.T) {

// Add one element to the stack.
// The stack should be equal to [0x1].
evm.stack.Push(uint256.NewInt(1))
err := evm.stack.Push(uint256.NewInt(1))
if err != nil {
t.Errorf("Push() returned an unexpected error: %v", err)
}

// Try to add the two elements at the top of the stack.
err := evm.Add()
err = evm.Add()
if err == nil {
t.Error("Add() should return an error because there is only one element in the stack")
}
Expand All @@ -86,15 +100,3 @@ func TestAddOnFullStack(t *testing.T) {
t.Error("Add() should return an error because the stack is full")
}
}

func TestMul(t *testing.T) {
// TODO
}

func TestSub(t *testing.T) {
// TODO
}

func TestDiv(t *testing.T) {
// TODO
}

0 comments on commit 010ebed

Please sign in to comment.