Skip to content

Commit

Permalink
Test empty NewFlags
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Dec 2, 2024
1 parent 06b4aa6 commit 81dbb76
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,14 @@ func TestEquals(t *testing.T) {
}

func TestNewFlags(t *testing.T) {
flags, err := NewFlags("--hello=world --bar=baz")
require.NoError(t, err)
require.Equal(t, "world", flags.GetValue("--hello"))
require.Equal(t, "baz", flags.GetValue("--bar"))
t.Run("basic", func(t *testing.T) {
flags, err := NewFlags("--hello=world --bar=baz")
require.NoError(t, err)
require.Equal(t, "world", flags.GetValue("--hello"))
require.Equal(t, "baz", flags.GetValue("--bar"))
})
t.Run("empty", func(t *testing.T) {
_, err := NewFlags("")
require.NoError(t, err)
})
}

0 comments on commit 81dbb76

Please sign in to comment.