diff --git a/src/compiler/Compile_test.go b/src/compiler/Compile_test.go index 97cdbbe..632c73e 100644 --- a/src/compiler/Compile_test.go +++ b/src/compiler/Compile_test.go @@ -1,7 +1,6 @@ package compiler_test import ( - "errors" "testing" "git.urbach.dev/cli/q/src/compiler" @@ -15,13 +14,6 @@ func TestNotExisting(t *testing.T) { assert.NotNil(t, err) } -func TestNoInputFiles(t *testing.T) { - b := config.New(".") - _, err := compiler.Compile(b) - assert.NotNil(t, err) - assert.True(t, errors.Is(err, compiler.MissingMainFunction)) -} - func TestHelloExample(t *testing.T) { b := config.New("../../examples/hello") _, err := compiler.Compile(b) diff --git a/src/compiler/errors_test.go b/src/compiler/errors_test.go index 451ac7a..f2bfb75 100644 --- a/src/compiler/errors_test.go +++ b/src/compiler/errors_test.go @@ -14,6 +14,7 @@ var errs = []struct { File string ExpectedError error }{ + {"MissingMainFunction.q", compiler.MissingMainFunction}, {"UnusedImport.q", &compiler.UnusedImport{Package: "os"}}, } diff --git a/src/compiler/testdata/MissingMainFunction.q b/src/compiler/testdata/MissingMainFunction.q new file mode 100644 index 0000000..e69de29