Add test cases for a helper function in controller manager

This commit is contained in:
Haines Chan
2019-05-27 17:10:30 +08:00
parent a931227952
commit 01f1cf3c96

View File

@@ -60,6 +60,20 @@ func TestIsControllerEnabled(t *testing.T) {
disabledByDefaultControllers: []string{"delta", "echo"},
expected: false,
},
{
name: "on by star, not off by name",
controllerName: "alpha",
controllers: []string{"*", "-charlie"},
disabledByDefaultControllers: []string{"delta", "echo"},
expected: true,
},
{
name: "off by name with star",
controllerName: "charlie",
controllers: []string{"*", "-charlie"},
disabledByDefaultControllers: []string{"delta", "echo"},
expected: false,
},
{
name: "off by default implicit, no star",
controllerName: "foxtrot",