MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestIPList_Update

Function TestIPList_Update

internal/iplibrary/ip_list_test.go:75–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestIPList_Update(t *testing.T) {
76 var ipList = iplibrary.NewIPList()
77 ipList.Add(&iplibrary.IPItem{
78 Id: 1,
79 IPFrom: iputils.ToBytes("192.168.1.1"),
80 })
81
82 t.Log("===before===")
83 logs.PrintAsJSON(ipList.ItemsMap(), t)
84 logs.PrintAsJSON(ipList.SortedRangeItems(), t)
85 logs.PrintAsJSON(ipList.IPMap(), t)
86
87 /**ipList.Add(&iplibrary.IPItem{
88 Id: 2,
89 IPFrom: iputils.ToBytes("192.168.1.1"),
90 })**/
91 ipList.Add(&iplibrary.IPItem{
92 Id: 1,
93 //IPFrom: 123,
94 IPTo: iputils.ToBytes("192.168.1.2"),
95 })
96
97 t.Log("===after===")
98 logs.PrintAsJSON(ipList.ItemsMap(), t)
99 logs.PrintAsJSON(ipList.SortedRangeItems(), t)
100 logs.PrintAsJSON(ipList.IPMap(), t)
101}
102
103func TestIPList_Update_AllItems(t *testing.T) {
104 var ipList = iplibrary.NewIPList()

Callers

nothing calls this directly

Calls 6

NewIPListFunction · 0.92
LogMethod · 0.80
SortedRangeItemsMethod · 0.80
AddMethod · 0.65
ItemsMapMethod · 0.45
IPMapMethod · 0.45

Tested by

no test coverage detected