From 8d38c84713cdd7b569452de8807d6d3857caa38c Mon Sep 17 00:00:00 2001 From: Arjun Khunti Date: Tue, 31 Oct 2023 15:20:56 +0530 Subject: [PATCH] Added empty op val and non-empty flagName test --- check/test.go | 2 +- check/test_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/check/test.go b/check/test.go index 2aee9b0b0..99699e8ef 100644 --- a/check/test.go +++ b/check/test.go @@ -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 { diff --git a/check/test_test.go b/check/test_test.go index 29eb26922..be18e2aa8 100644 --- a/check/test_test.go +++ b/check/test_test.go @@ -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",