Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #53 from kastolars/karol/51
Browse files Browse the repository at this point in the history
  • Loading branch information
everettraven authored Jan 26, 2022
2 parents e910881 + b92053c commit 24856bb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions subcommands/subcommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,27 @@ func TestSubCommandUnknownSC(t *testing.T) {
}
}
}

func TestLengthArgs(t *testing.T) {
//Create a mock subcommand
msc := NewMockSC()

//Set the error message
msc.ErrorMsg = "Test error is being throw properly if the length of the args variable is < 1"

//Create an argument array
args := []string{}

//Create an array of Runner interface containing the mock subcommand
scmds := []Runner{
msc,
}

//Run the SubCommand function
err := SubCommand(args, scmds)

//Should have an error
if err == nil {
t.Fatalf("SubCommand: Expected to have error: %s | Received No Error", msc.ErrorMsg)
}
}

0 comments on commit 24856bb

Please sign in to comment.