main: add error tests for the compiler

The compiler can in fact return errors, but these weren't tested yet.
This commit is contained in:
Ayke van Laethem
2024-07-12 17:05:04 +02:00
committed by Ron Evans
parent a5f78a3900
commit f4ce11ef37
2 changed files with 14 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ import (
func TestErrors(t *testing.T) {
for _, name := range []string{
"cgo",
"compiler",
"interp",
"loader-importcycle",
"loader-invaliddep",
+13
View File
@@ -0,0 +1,13 @@
package main
//go:wasmimport foo bar
func foo() {
}
//go:align 7
var global int
// TODO: include package name in the error message
// ERROR: compiler.go:4:6: can only use //go:wasmimport on declarations
// ERROR: compiler.go:8:5: global variable alignment must be a positive power of two