mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
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:
committed by
Ron Evans
parent
a5f78a3900
commit
f4ce11ef37
@@ -17,6 +17,7 @@ import (
|
||||
func TestErrors(t *testing.T) {
|
||||
for _, name := range []string{
|
||||
"cgo",
|
||||
"compiler",
|
||||
"interp",
|
||||
"loader-importcycle",
|
||||
"loader-invaliddep",
|
||||
|
||||
Vendored
+13
@@ -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
|
||||
Reference in New Issue
Block a user