Skip to content

Commit e54d990

Browse files
committed
unittest: fix length assertion (#2597)
1 parent f731350 commit e54d990

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/unittest/util/net.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var _ = Describe("[Net]", func() {
2323
2,
2424
254,
2525
}
26-
Expect(len(args)).To(Equal(len(args)))
26+
Expect(args).To(HaveLen(len(wants)))
2727

2828
for i := range args {
2929
Expect(args[i].IP).NotTo(BeNil())
@@ -42,7 +42,7 @@ var _ = Describe("[Net]", func() {
4242
5,
4343
15,
4444
}
45-
Expect(len(args)).To(Equal(len(args)))
45+
Expect(args).To(HaveLen(len(wants)))
4646

4747
for i := range args {
4848
Expect(util.CountIpNums(args[i])).To(Equal(wants[i]))
@@ -137,7 +137,7 @@ var _ = Describe("[Net]", func() {
137137
{"fe00::101", "fe00::1a1..fe00::1a5"},
138138
{"10.0.1.1", "10.0.1.101..10.0.1.105", "fe00::101", "fe00::1a1..fe00::1a5"},
139139
}
140-
Expect(len(args)).To(Equal(len(args)))
140+
Expect(args).To(HaveLen(len(wants)))
141141

142142
for i := range args {
143143
Expect(util.ExpandExcludeIPs(args[i].excludeIps, args[i].cidr)).To(Equal(wants[i]))

0 commit comments

Comments
 (0)