Added more tests
This commit is contained in:
7
tests/errors/TypeMismatch3.q
Normal file
7
tests/errors/TypeMismatch3.q
Normal file
@ -0,0 +1,7 @@
|
||||
import mem
|
||||
|
||||
main() {
|
||||
a := mem.alloc(16)
|
||||
b := a["not a number"]
|
||||
b += 1
|
||||
}
|
6
tests/errors/TypeMismatch4.q
Normal file
6
tests/errors/TypeMismatch4.q
Normal file
@ -0,0 +1,6 @@
|
||||
import mem
|
||||
|
||||
main() {
|
||||
a := mem.alloc(16)
|
||||
a["not a number"] = 42
|
||||
}
|
6
tests/errors/UntypedExpression.q
Normal file
6
tests/errors/UntypedExpression.q
Normal file
@ -0,0 +1,6 @@
|
||||
main() {
|
||||
a := unknown()
|
||||
a += 1
|
||||
}
|
||||
|
||||
unknown() {}
|
@ -57,6 +57,7 @@ var errs = []struct {
|
||||
{"UnknownIdentifier3.q", &errors.UnknownIdentifier{Name: "x"}},
|
||||
{"UnknownPackage.q", &errors.UnknownPackage{Name: "sys"}},
|
||||
{"UnknownStructField.q", &errors.UnknownStructField{StructName: "A", FieldName: "x"}},
|
||||
{"UntypedExpression.q", errors.UntypedExpression},
|
||||
{"UnusedImport.q", &errors.UnusedImport{Package: "sys"}},
|
||||
{"UnusedVariable.q", &errors.UnusedVariable{Name: "x"}},
|
||||
{"VariableAlreadyExists.q", &errors.VariableAlreadyExists{Name: "x"}},
|
||||
|
Reference in New Issue
Block a user