wasm test suite (#1116)

* wasm: add test suite using headlless chrome
This commit is contained in:
Brad Peabody
2020-05-23 05:12:01 -07:00
committed by GitHub
parent dda576e80b
commit 95f509b109
13 changed files with 447 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package main
func main() {
ch := make(chan bool, 1)
println("1")
go func() {
println("2")
ch <- true
println("3")
}()
println("4")
v := <-ch
println(v)
}
+31
View File
@@ -0,0 +1,31 @@
package main
import "syscall/js"
func main() {
ch := make(chan bool, 1)
println("1")
js.Global().
Get("document").
Call("querySelector", "#main").
Set("innerHTML", `<button id="testbtn">Test</button>`)
js.Global().
Get("document").
Call("querySelector", "#testbtn").
Call("addEventListener", "click",
js.FuncOf(func(this js.Value, args []js.Value) interface{} {
println("2")
ch <- true
println("3")
return nil
}))
println("4")
v := <-ch
println(v)
}
+8
View File
@@ -0,0 +1,8 @@
package main
import "fmt"
func main() {
var _ fmt.Stringer
println("did not panic")
}
+11
View File
@@ -0,0 +1,11 @@
package main
import "fmt"
func main() {
fmt.Println("test from fmtprint 1")
fmt.Print("test from fmtprint 2\n")
fmt.Print("test from fmtp")
fmt.Print("rint 3\n")
fmt.Printf("test from fmtprint %d\n", 4)
}