Moved tests to a separate directory
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
package errors_test
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build"
|
||||
"git.akyoto.dev/cli/q/src/errors"
|
||||
"git.akyoto.dev/go/assert"
|
||||
)
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
tests := []struct {
|
||||
File string
|
||||
ExpectedError error
|
||||
}{
|
||||
{"ExpectedFunctionDefinition.q", errors.ExpectedFunctionDefinition},
|
||||
{"ExpectedFunctionParameters.q", errors.ExpectedFunctionParameters},
|
||||
{"MissingBlockEnd.q", errors.MissingBlockEnd},
|
||||
{"MissingBlockStart.q", errors.MissingBlockStart},
|
||||
{"MissingGroupEnd.q", errors.MissingGroupEnd},
|
||||
{"MissingGroupStart.q", errors.MissingGroupStart},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
name := strings.TrimSuffix(test.File, ".q")
|
||||
|
||||
t.Run(name, func(t *testing.T) {
|
||||
b := build.New(filepath.Join("testdata", test.File))
|
||||
_, err := b.Run()
|
||||
assert.NotNil(t, err)
|
||||
assert.Contains(t, err.Error(), test.ExpectedError.Error())
|
||||
})
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
main()
|
@ -1 +0,0 @@
|
||||
main
|
1
src/errors/testdata/MissingBlockEnd.q
vendored
1
src/errors/testdata/MissingBlockEnd.q
vendored
@ -1 +0,0 @@
|
||||
main(){
|
1
src/errors/testdata/MissingBlockStart.q
vendored
1
src/errors/testdata/MissingBlockStart.q
vendored
@ -1 +0,0 @@
|
||||
main()}
|
1
src/errors/testdata/MissingGroupEnd.q
vendored
1
src/errors/testdata/MissingGroupEnd.q
vendored
@ -1 +0,0 @@
|
||||
main(
|
1
src/errors/testdata/MissingGroupStart.q
vendored
1
src/errors/testdata/MissingGroupStart.q
vendored
@ -1 +0,0 @@
|
||||
main)
|
Reference in New Issue
Block a user