
Panics are bad for usability: whenever something breaks, the user is shown a (not very informative) backtrace. Replace it with real error messages instead, that even try to display the Go source location.
17 строки
262 Б
Go
17 строки
262 Б
Go
package transform
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"tinygo.org/x/go-llvm"
|
|
)
|
|
|
|
func TestInterfaceLowering(t *testing.T) {
|
|
t.Parallel()
|
|
testTransform(t, "testdata/interface", func(mod llvm.Module) {
|
|
err := LowerInterfaces(mod)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
})
|
|
}
|