Add tests

Kubernetes-commit: 5dca1be0160f5b5cb3c85b2ab44d569290eaa1f4
This commit is contained in:
Marly Puckett 2023-02-11 15:10:56 -08:00 committed by Kubernetes Publisher
parent 2d86c3a191
commit 9ae9023ede
1 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,20 @@ func TestSplitAndParseResourceRequest(t *testing.T) {
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
expectedFieldsPath: []string{"field2", "field3"},
},
{
name: "field with dots 1",
inResource: `service.field2['field\.with\.dots']`,
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
expectedFieldsPath: []string{"field2", "field.with.dots"},
},
{
name: "field with dots 2",
inResource: `service.field2.field\.with\.dots`,
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
expectedFieldsPath: []string{"field2", "field.with.dots"},
},
{
name: "trailing period with incorrect fieldsPath",
inResource: "node.field2.field3.",