We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f9141f2 + 9e8f3f4 commit 57c12daCopy full SHA for 57c12da
examples/singleapp/test_pkg_coexist/Makefile
@@ -0,0 +1,2 @@
1
+run:
2
+ go test -v .
examples/singleapp/test_pkg_coexist/README.md
@@ -0,0 +1,10 @@
+# 概要
+
3
+Go では、テストを作成する際にパッケージを
4
5
+- 対象パッケージ
6
+- 対象パッケージ_test
7
8
+の2つを使うことが出来ます。
9
10
+そして、この2つは例外として共存出来ます。
examples/singleapp/test_pkg_coexist/a_test.go
@@ -0,0 +1,14 @@
+package testpkgcoexist
+import "testing"
+func TestA(t *testing.T) {
+ var (
+ a, b = 1, 10
+ )
+ c := a * 10
11
+ if c != b {
12
+ t.Errorf("[want] %v\t[got] %v", b, c)
13
+ }
14
+}
examples/singleapp/test_pkg_coexist/b_test.go
+package testpkgcoexist_test
+func TestB(t *testing.T) {
0 commit comments