Skip to content

Commit 5308f8c

Browse files
committed
Add another test for coverage
1 parent 49615d6 commit 5308f8c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

internal/controller/state/graph/route_common_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ func TestBuildSectionNameRefs(t *testing.T) {
156156
name: "duplicate sectionNames",
157157
expectedError: errors.New("duplicate section name \"http\" for Gateway test/gateway-1"),
158158
},
159+
{
160+
parentRefs: []gatewayv1.ParentReference{
161+
{
162+
Name: gatewayv1.ObjectName(gwNsName3.Name),
163+
SectionName: helpers.GetPointer[gatewayv1.SectionName]("http"),
164+
},
165+
{
166+
Name: gatewayv1.ObjectName(gwNsName3.Name),
167+
SectionName: nil,
168+
},
169+
},
170+
name: "duplicate sectionNames when one parentRef has no sectionName",
171+
expectedError: errors.New("duplicate section name \"http\" for Gateway test/gateway-3"),
172+
},
159173
}
160174

161175
for _, test := range tests {

0 commit comments

Comments
 (0)