Added file scanner

This commit is contained in:
2023-10-30 16:17:41 +01:00
parent 5fe83543fd
commit 8b19989372
10 changed files with 178 additions and 71 deletions

View File

@ -7,6 +7,7 @@ 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) {
@ -29,16 +30,13 @@ func TestCLI(t *testing.T) {
{[]string{"build", "examples/hello/hello.q"}, 1},
{[]string{"build", "examples/hello", "--invalid"}, 2},
{[]string{"build", "examples/hello", "--dry"}, 0},
{[]string{"build", "examples/hello", "--dry", "--verbose"}, 0},
}
for _, test := range tests {
t.Log(test.arguments)
exitCode := cli.Main(test.arguments)
if exitCode != test.expectedExitCode {
t.Errorf("exit code %d (expected %d)", exitCode, test.expectedExitCode)
t.FailNow()
}
assert.Equal(t, exitCode, test.expectedExitCode)
}
}