Skip to content

Commit

Permalink
Added empty op val and non-empty flagName test
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunkhunti-crest authored Oct 31, 2023
1 parent 0918b41 commit 8d38c84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion check/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions check/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8d38c84

Please sign in to comment.