Skip to content

Commit

Permalink
add TestVersionOnly() test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pashagolub committed Feb 4, 2022
1 parent da02dc1 commit 159ecfd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/config/cmdparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ func TestLogLevel(t *testing.T) {
assert.False(t, c.Verbose())
}

func TestVersionOnly(t *testing.T) {
c := &CmdOptions{Version: true}
os.Args = []string{0: "go-test", "-v"}
assert.True(t, c.VersionOnly())
c = &CmdOptions{Version: false}
assert.False(t, c.VersionOnly())
}

func TestNewCmdOptions(t *testing.T) {
c := NewCmdOptions("-c", "config_unit_test", "--password=somestrong")
assert.NotNil(t, c)
Expand Down

0 comments on commit 159ecfd

Please sign in to comment.