Skip to content

Commit

Permalink
Add tests for invalid flag values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Witkowski committed Sep 19, 2023
1 parent 34aef0a commit b847558
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cmd/provenanced/cmd/docgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,34 @@ func TestDocGen(t *testing.T) {
createTarget: false,
err: "mkdir %s: no such file or directory",
},
{
name: "failure - bad yaml value",
target: "tmp",
createTarget: true,
flags: []string{"--yaml=xyz"},
err: "invalid argument \"xyz\" for \"--yaml\" flag: strconv.ParseBool: parsing \"xyz\": invalid syntax",
},
{
name: "failure - bad rest value",
target: "tmp",
createTarget: true,
flags: []string{"--rest=xyz"},
err: "invalid argument \"xyz\" for \"--rest\" flag: strconv.ParseBool: parsing \"xyz\": invalid syntax",
},
{
name: "failure - bad markdown value",
target: "tmp",
createTarget: true,
flags: []string{"--markdown=xyz"},
err: "invalid argument \"xyz\" for \"--markdown\" flag: strconv.ParseBool: parsing \"xyz\": invalid syntax",
},
{
name: "failure - bad manpage value",
target: "tmp",
createTarget: true,
flags: []string{"--manpage=xyz"},
err: "invalid argument \"xyz\" for \"--manpage\" flag: strconv.ParseBool: parsing \"xyz\": invalid syntax",
},
{
name: "success - yaml is generated",
target: "tmp",
Expand Down

0 comments on commit b847558

Please sign in to comment.