aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorCarolyn Van Slyck <[email protected]>2019-06-18 03:23:59 -0700
committerRon Evans <[email protected]>2019-06-18 12:23:59 +0200
commit208e1719ad9a8e7ff94e8aac900909c37747a04f (patch)
tree0ec53ee94cc447f84e6bbfe51ef68ad428bf2bf4 /tests
parenta3d1f1a514aaaad6c2bfe6024ee48211cf6b7575 (diff)
downloadtinygo-208e1719ad9a8e7ff94e8aac900909c37747a04f.tar.gz
tinygo-208e1719ad9a8e7ff94e8aac900909c37747a04f.zip
Add test command to tinygo (#243)
* Add test command to tinygo
Diffstat (limited to 'tests')
-rw-r--r--tests/tinygotest/main.go14
-rw-r--r--tests/tinygotest/main_test.go16
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/tinygotest/main.go b/tests/tinygotest/main.go
new file mode 100644
index 000000000..84ed97000
--- /dev/null
+++ b/tests/tinygotest/main.go
@@ -0,0 +1,14 @@
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ Thing()
+ fmt.Println("normal main")
+}
+
+func Thing() {
+ fmt.Println("THING")
+}
diff --git a/tests/tinygotest/main_test.go b/tests/tinygotest/main_test.go
new file mode 100644
index 000000000..61ce28285
--- /dev/null
+++ b/tests/tinygotest/main_test.go
@@ -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) {
+}