Browse Source

main: add error tests for the compiler

The compiler can in fact return errors, but these weren't tested yet.
pull/4351/head
Ayke van Laethem 4 months ago
committed by Ron Evans
parent
commit
f4ce11ef37
  1. 1
      errors_test.go
  2. 13
      testdata/errors/compiler.go

1
errors_test.go

@ -17,6 +17,7 @@ import (
func TestErrors(t *testing.T) {
for _, name := range []string{
"cgo",
"compiler",
"interp",
"loader-importcycle",
"loader-invaliddep",

13
testdata/errors/compiler.go

@ -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
Loading…
Cancel
Save