Skip to content

Commit d2d56e8

Browse files
committed
update test
1 parent 587f064 commit d2d56e8

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

pkg/types/event_test.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package types
22

33
import (
4-
"net"
4+
"net/netip"
55
"testing"
66

77
"github.com/stretchr/testify/assert"
@@ -91,7 +91,7 @@ func TestParseIPSources(t *testing.T) {
9191
tests := []struct {
9292
name string
9393
evt Event
94-
expected []net.IP
94+
expected []netip.Addr
9595
}{
9696
{
9797
name: "ParseIPSources: Valid Log Sources",
@@ -101,8 +101,8 @@ func TestParseIPSources(t *testing.T) {
101101
"source_ip": "127.0.0.1",
102102
},
103103
},
104-
expected: []net.IP{
105-
net.ParseIP("127.0.0.1"),
104+
expected: []netip.Addr{
105+
netip.MustParseAddr("127.0.0.1"),
106106
},
107107
},
108108
{
@@ -115,8 +115,8 @@ func TestParseIPSources(t *testing.T) {
115115
},
116116
},
117117
},
118-
expected: []net.IP{
119-
net.ParseIP("127.0.0.1"),
118+
expected: []netip.Addr{
119+
netip.MustParseAddr("127.0.0.1"),
120120
},
121121
},
122122
{
@@ -127,9 +127,7 @@ func TestParseIPSources(t *testing.T) {
127127
"source_ip": "IAMNOTANIP",
128128
},
129129
},
130-
expected: []net.IP{
131-
nil,
132-
},
130+
expected: nil,
133131
},
134132
{
135133
name: "ParseIPSources: Invalid Overflow Sources",
@@ -141,9 +139,7 @@ func TestParseIPSources(t *testing.T) {
141139
},
142140
},
143141
},
144-
expected: []net.IP{
145-
nil,
146-
},
142+
expected: nil,
147143
},
148144
}
149145

0 commit comments

Comments
 (0)