Add unit test to check outbound mixed-case merging

This commit is contained in:
Bryan Boreham authored and Matthias Radestock committed 2015-11-02 20:01:40 +00:00
1 parent fc1d837501
commit 64f7953423
1 file changed
+28
+28
View File
@@ -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)
}