Improved build performance
This commit is contained in:
11
main_test.go
11
main_test.go
@ -7,7 +7,6 @@ import (
|
||||
|
||||
"git.akyoto.dev/cli/q/src/cli"
|
||||
"git.akyoto.dev/cli/q/src/log"
|
||||
"git.akyoto.dev/go/assert"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
@ -28,14 +27,18 @@ func TestCLI(t *testing.T) {
|
||||
{[]string{"system"}, 0},
|
||||
{[]string{"build", "non-existing-directory"}, 1},
|
||||
{[]string{"build", "examples/hello/hello.q"}, 1},
|
||||
{[]string{"build", "examples/hello", "--dry"}, 0},
|
||||
{[]string{"build", "examples/hello", "--invalid"}, 2},
|
||||
{[]string{"build", "examples/hello", "--dry"}, 0},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
exitCode := cli.Main(test.arguments)
|
||||
t.Log(test.arguments)
|
||||
assert.Equal(t, exitCode, test.expectedExitCode)
|
||||
exitCode := cli.Main(test.arguments)
|
||||
|
||||
if exitCode != test.expectedExitCode {
|
||||
t.Errorf("exit code %d (expected %d)", exitCode, test.expectedExitCode)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user