Added CLI commands

This commit is contained in:
2023-10-17 14:01:01 +02:00
parent 19d23eeec4
commit c3925e86b3
10 changed files with 143 additions and 2 deletions

27
cli_test.go Normal file
View File

@ -0,0 +1,27 @@
package main_test
import (
"testing"
"git.akyoto.dev/cli/q/cli"
"git.akyoto.dev/go/assert"
)
func TestCLI(t *testing.T) {
type cliTest struct {
arguments []string
expectedExitCode int
}
tests := []cliTest{
{[]string{}, 1},
{[]string{"invalid"}, 1},
{[]string{"system"}, 0},
}
for _, test := range tests {
exitCode := cli.Main(test.arguments)
t.Log(test.arguments)
assert.Equal(t, exitCode, test.expectedExitCode)
}
}