Add test command to tinygo (#243)

* Add test command to tinygo
This commit is contained in:
Carolyn Van Slyck
2019-06-18 03:23:59 -07:00
committed by Ron Evans
parent a3d1f1a514
commit 208e1719ad
9 changed files with 288 additions and 13 deletions
+14
View File
@@ -0,0 +1,14 @@
package main
import (
"fmt"
)
func main() {
Thing()
fmt.Println("normal main")
}
func Thing() {
fmt.Println("THING")
}
+16
View File
@@ -0,0 +1,16 @@
package main
import (
"testing" // This is the tinygo testing package
)
func TestFail1(t *testing.T) {
t.Error("TestFail1 failed because of stuff and things")
}
func TestFail2(t *testing.T) {
t.Error("TestFail2 failed for reasons")
}
func TestPass(t *testing.T) {
}