watchtower/wtclient: add Copy method to AddressIterator

This commit is contained in:
Elle Mouton committed 2023-03-20 16:51:32 +02:00
1 parent 2b08d3443f
commit 0209e6feb8
3 files changed
+39 -5

No files matched your search

@@ -97,6 +97,11 @@ func TestAddrIterator(t *testing.T) {
addrList := iter.GetAll()
require.ElementsMatch(t, addrList, []net.Addr{addr1, addr2, addr3})
// Also check that an iterator constructed via the Copy method, also
// contains all the expected addresses.
newIterAddrs := iter.Copy().GetAll()
require.ElementsMatch(t, newIterAddrs, []net.Addr{addr1, addr2, addr3})
// Let's now remove addr3.
err = iter.Remove(addr3)
require.NoError(t, err)