Skip to content

Commit 8aa7920

Browse files
committed
add test
1 parent 08dfd00 commit 8aa7920

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cmd/git-semv/cli_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Options:
2828
-h, --help Show this help message and exit
2929
-v, --version Prints the version number
3030
`
31-
unknown := `Error: command is not available
31+
unknownFlag := "Error: unknown flag `unknown'\n"
32+
unknownCmd := `Error: command is not available
3233
`
3334

3435
tests := []struct {
@@ -41,7 +42,8 @@ Options:
4142
{[]string{"--help"}, []byte(help), []byte(""), ExitErr},
4243
{[]string{"-v"}, []byte(""), []byte(ver), ExitOK},
4344
{[]string{"--version"}, []byte(""), []byte(ver), ExitOK},
44-
{[]string{"unknown"}, []byte(help), []byte(unknown), ExitErr},
45+
{[]string{"--unknown=abc"}, []byte(""), []byte(unknownFlag), ExitErr},
46+
{[]string{"unknown"}, []byte(help), []byte(unknownCmd), ExitErr},
4547
}
4648

4749
for i, tt := range tests {

0 commit comments

Comments
 (0)