aboutsummaryrefslogtreecommitdiffstats
path: root/gocapturedrefrace_test.go
diff options
context:
space:
mode:
authorTeddy Wing2023-05-16 19:53:19 +0200
committerTeddy Wing2023-05-16 19:53:19 +0200
commit5afcd02ea68efd3faba578bdcee853c028b14e0e (patch)
treefa5e230b7403febab284616814fa23d43c2fa70b /gocapturedrefrace_test.go
parent3eef30cf630eda3837a27a237e89207e1ce3dabf (diff)
downloadgocapturedrefrace-5afcd02ea68efd3faba578bdcee853c028b14e0e.tar.bz2
Add automated test
Follow `golang.org/x/tools/go/analysis/passes/testinggoroutine` to write the test runner: https://github.com/golang/tools/blob/1c9fe3f82c363b929ef7239ca0ad8a5dafbbcf05/go/analysis/passes/testinggoroutine/testinggoroutine_test.go Add "want" comments to test code for validation.
Diffstat (limited to 'gocapturedrefrace_test.go')
-rw-r--r--gocapturedrefrace_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/gocapturedrefrace_test.go b/gocapturedrefrace_test.go
new file mode 100644
index 0000000..d2e82b2
--- /dev/null
+++ b/gocapturedrefrace_test.go
@@ -0,0 +1,14 @@
+package gocapturedrefrace_test
+
+import (
+ "testing"
+
+ "golang.org/x/tools/go/analysis/analysistest"
+ "gopkg.teddywing.com/gocapturedrefrace"
+)
+
+func Test(t *testing.T) {
+ testdata := analysistest.TestData()
+
+ analysistest.Run(t, testdata, gocapturedrefrace.Analyzer, ".")
+}