mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +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) {
|
func TestRemoveItemInArray(t *testing.T) {
|
||||||
array := []Address{HexToAddress("0x0000003"), HexToAddress("0x0000001"), HexToAddress("0x0000002"), HexToAddress("0x0000003")}
|
array := []Address{HexToAddress("0x0000003"), HexToAddress("0x0000001"), HexToAddress("0x0000002"), HexToAddress("0x0000003")}
|
||||||
remove := []Address{HexToAddress("0x0000002"), HexToAddress("0x0000004"), HexToAddress("0x0000003")}
|
remove := []Address{HexToAddress("0x0000002"), HexToAddress("0x0000004"), HexToAddress("0x0000003")}
|
||||||
array = RemoveItemFromArray(array, remove)
|
newArray := RemoveItemFromArray(array, remove)
|
||||||
if len(array) != 1 {
|
|
||||||
|
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")
|
t.Error("fail remove item from array address")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue