mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
eth/tracers/logger: error comparison test
This commit is contained in:
parent
4920d8127f
commit
7b3cb25847
1 changed files with 15 additions and 0 deletions
|
|
@ -108,3 +108,18 @@ func TestStructLogMarshalingOmitEmpty(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestErrorCompare(t *testing.T) {
|
||||
err := vm.ErrExecutionReverted
|
||||
if err != vm.ErrExecutionReverted {
|
||||
t.Fatal("error compare")
|
||||
}
|
||||
// wrap err and test again
|
||||
err = vm.VMErrorFromErr(err)
|
||||
if err == vm.ErrExecutionReverted { // equality comparison fails
|
||||
t.Fatal("error compare should fail")
|
||||
}
|
||||
if !errors.Is(err, vm.ErrExecutionReverted) { // check all wrapped errors
|
||||
t.Fatal("error compare: err is not a vm.ErrExecutionReverted")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue