mirror of https://github.com/tinygo-org/tinygo.git
wasmstm32webassemblymicrocontrollerarmavrspiwasiadafruitarduinocircuitplayground-expressgpioi2cllvmmicrobitnrf51nrf52nrf52840samd21tinygo
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
512 B
31 lines
512 B
package wasm
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/chromedp/chromedp"
|
|
)
|
|
|
|
func TestFmt(t *testing.T) {
|
|
|
|
wasmTmpDir, server := startServer(t)
|
|
|
|
err := run(t, "tinygo build -o "+wasmTmpDir+"/fmt.wasm -target wasm testdata/fmt.go")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
ctx := chromectx(t)
|
|
|
|
var log1 string
|
|
err = chromedp.Run(ctx,
|
|
chromedp.Navigate(server.URL+"/run?file=fmt.wasm"),
|
|
chromedp.InnerHTML("#log", &log1),
|
|
waitLog(`did not panic`),
|
|
)
|
|
t.Logf("log1: %s", log1)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
}
|
|
|