Skip to content

Commit

Permalink
Fix help format and add tests, closes #13, #15
Browse files Browse the repository at this point in the history
  • Loading branch information
rednafi committed Sep 3, 2023
1 parent a05ca38 commit 0a03da6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,15 @@ func TestCliError(t *testing.T) {
}
buf.Reset()

// Using -cat without -list
// Using --cat without --list
os.Args = []string{"cli", "--cat", "6"}
Cli(w, "v1.0", func(int) {})
if !strings.Contains(buf.String(), "error: cannot use --cat without --list") {
t.Errorf("Expected error message to be printed, got %s\n", buf.String())
}
buf.Reset()

// Using -cat with -list but invalid category
// Using --cat with --list but invalid category
os.Args = []string{"cli", "--list", "--cat", "6"}
Cli(w, "v1.0", func(int) {})

Expand All @@ -382,7 +382,7 @@ func TestCliError(t *testing.T) {
}
buf.Reset()

// Using -list after -cat but without category value
// Using --list after --cat but without category value
os.Args = []string{"cli", "--cat", "-list"}
Cli(w, "v1.0", func(int) {})

Expand Down

0 comments on commit 0a03da6

Please sign in to comment.