1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2025-07-08 15:48:18 +00:00

Added empty op val and non-empty flagName test

This commit is contained in:
Arjun Khunti 2023-10-31 15:20:56 +05:30 committed by GitHub
parent 0918b41eca
commit 8d38c84713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -143,7 +143,7 @@ func (t flagTestItem) findValue(s string) (match bool, value string, err error)
if strings.HasPrefix(t.Flag, "--") {
value = "true"
} else {
value = vals[1]
value = ""
}
}
} else {

View File

@ -600,6 +600,7 @@ func TestCompareOp(t *testing.T) {
// Test Op "eq"
{label: "op=eq, both empty", op: "eq", flagVal: "", compareValue: "", expectedResultPattern: "'' is equal to ''", testResult: true, flagName: ""},
{label: "op=eq, both empty, flagName non empty", op: "eq", flagVal: "", compareValue: "", expectedResultPattern: "'' is equal to ''", testResult: true, flagName: "flagName"},
{
label: "op=eq, true==true", op: "eq", flagVal: "true",