mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 21:54:30 +00:00
update test for RemoveItemFromArray
This commit is contained in:
parent
d0cde5c51e
commit
5764dbc249
1 changed files with 6 additions and 2 deletions
|
|
@ -158,8 +158,12 @@ func BenchmarkAddressHex(b *testing.B) {
|
|||
func TestRemoveItemInArray(t *testing.T) {
|
||||
array := []Address{HexToAddress("0x0000003"), HexToAddress("0x0000001"), HexToAddress("0x0000002"), HexToAddress("0x0000003")}
|
||||
remove := []Address{HexToAddress("0x0000002"), HexToAddress("0x0000004"), HexToAddress("0x0000003")}
|
||||
array = RemoveItemFromArray(array, remove)
|
||||
if len(array) != 1 {
|
||||
newArray := RemoveItemFromArray(array, remove)
|
||||
|
||||
if array[0] != HexToAddress("0x0000003") || array[2] != HexToAddress("0x0000002") {
|
||||
t.Error("should keep the original item from array address")
|
||||
}
|
||||
if len(newArray) != 1 {
|
||||
t.Error("fail remove item from array address")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue