GODT-2150: fixed initial implementation that filtered --no-window in gui instead of bridge.

This commit is contained in:
Xavier Michelon
2022-11-30 19:03:35 +01:00
parent 6b8faf0ecf
commit f3cc19b09c
3 changed files with 23 additions and 2 deletions

View File

@ -41,3 +41,20 @@ func TestRemoveFlagWithValue(t *testing.T) {
require.Equal(t, removeFlagWithValue(tt.argList, tt.flag), tt.expected)
}
}
func TestRemoveFlag(t *testing.T) {
tests := []struct {
argList []string
flag string
expected []string
}{
{[]string{}, "b", []string{}},
{[]string{"-a", "-b", "-c"}, "b", []string{"-a", "-c"}},
{[]string{"-a", "--b", "-b"}, "b", []string{"-a"}},
{[]string{"-a", "-c"}, "b", []string{"-a", "-c"}},
}
for _, tt := range tests {
require.Equal(t, removeFlag(tt.argList, tt.flag), tt.expected)
}
}