Add unit test to check outbound mixed-case merging
This commit is contained in:
1 parent
fc1d837501
commit
64f7953423
1 file changed
+28
@@ -130,3 +130,31 @@ func TestLookup(t *testing.T) {
|
||||
}
|
||||
require.Equal(t, have, want)
|
||||
}
|
||||
|
||||
func TestGossipDataMerge(t *testing.T) {
|
||||
g1 := GossipData{Entries: Entries{
|
||||
Entry{Hostname: "A"},
|
||||
Entry{Hostname: "c"},
|
||||
Entry{Hostname: "D"},
|
||||
Entry{Hostname: "f"},
|
||||
}}
|
||||
|
||||
g2 := GossipData{Entries: Entries{
|
||||
Entry{Hostname: "B"},
|
||||
Entry{Hostname: "E"},
|
||||
Entry{Hostname: "f"},
|
||||
}}
|
||||
|
||||
g1.Merge(&g2)
|
||||
|
||||
expected := GossipData{Entries: Entries{
|
||||
Entry{Hostname: "A"},
|
||||
Entry{Hostname: "B"},
|
||||
Entry{Hostname: "c"},
|
||||
Entry{Hostname: "D"},
|
||||
Entry{Hostname: "E"},
|
||||
Entry{Hostname: "f"},
|
||||
}}
|
||||
|
||||
require.Equal(t, expected, g1)
|
||||
}
|
||||
Reference in new issue
Block a user