mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 04:56:36 +00:00
accounts/abi: fix unittest code (#34740)
1. should use !reflect.DeepEqual.
2. big.NewInt(0).SetBits([]big.Word{}) work around for DeepEqual when
big.Int is zero, unpack return a []big.Word{}.
This commit is contained in:
parent
91f8e7cd9e
commit
6af374e6aa
1 changed files with 2 additions and 2 deletions
|
|
@ -910,7 +910,7 @@ func TestUnpackTuple(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
FieldT: T{
|
FieldT: T{
|
||||||
big.NewInt(0), big.NewInt(1),
|
big.NewInt(0).SetBits([]big.Word{}), big.NewInt(1),
|
||||||
},
|
},
|
||||||
A: big.NewInt(1),
|
A: big.NewInt(1),
|
||||||
}
|
}
|
||||||
|
|
@ -919,7 +919,7 @@ func TestUnpackTuple(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
if reflect.DeepEqual(ret, expected) {
|
if !reflect.DeepEqual(ret, expected) {
|
||||||
t.Error("unexpected unpack value")
|
t.Error("unexpected unpack value")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue