@@ -100,12 +100,22 @@ func Foo(in string) string {return in} //@codeaction("Foo", "source.addTest", ed
100100-- missingtestfile/missingtestfile.go --
101101package main
102102
103+ type Bar struct {}
104+
105+ type foo struct {}
106+
103107func ExportedFunction(in string) string {return in} //@codeaction("ExportedFunction", "source.addTest", edit=missing_test_file_exported_function)
104108
105- type Bar struct {}
109+ func UnexportedInputParam(in string, f foo) string {return in} //@codeaction("UnexportedInputParam", "source.addTest", edit=missing_test_file_function_unexported_input)
110+
111+ func unexportedFunction(in string) string {return in} //@codeaction("unexportedFunction", "source.addTest", edit=missing_test_file_unexported_function)
106112
107113func (*Bar) ExportedMethod(in string) string {return in} //@codeaction("ExportedMethod", "source.addTest", edit=missing_test_file_exported_recv_exported_method)
108114
115+ func (*Bar) UnexportedInputParam(in string, f foo) string {return in} //@codeaction("UnexportedInputParam", "source.addTest", edit=missing_test_file_method_unexported_input)
116+
117+ func (*foo) ExportedMethod(in string) string {return in} //@codeaction("ExportedMethod", "source.addTest", edit=missing_test_file_unexported_recv)
118+
109119-- @missing_test_file_exported_function/missingtestfile/missingtestfile_test.go --
110120@@ -0,0 +1,26 @@
111121+package main_test
@@ -164,6 +174,112 @@ func (*Bar) ExportedMethod(in string) string {return in} //@codeaction("Exported
164174+ })
165175+ }
166176+}
177+ -- @missing_test_file_function_unexported_input/missingtestfile/missingtestfile_test.go --
178+ @@ -0,0 +1,24 @@
179+ +package main
180+ +
181+ +import "testing"
182+ +
183+ +func TestUnexportedInputParam(t *testing.T) {
184+ + tests := []struct {
185+ + name string // description of this test case
186+ + // Named input parameters for target function.
187+ + in string
188+ + f foo
189+ + want string
190+ + }{
191+ + // TODO: Add test cases.
192+ + }
193+ + for _, tt := range tests {
194+ + t.Run(tt.name, func(t *testing.T) {
195+ + got := UnexportedInputParam(tt.in, tt.f)
196+ + // TODO: update the condition below to compare got with tt.want.
197+ + if true {
198+ + t.Errorf("UnexportedInputParam() = %v, want %v", got, tt.want)
199+ + }
200+ + })
201+ + }
202+ +}
203+ -- @missing_test_file_method_unexported_input/missingtestfile/missingtestfile_test.go --
204+ @@ -0,0 +1,26 @@
205+ +package main
206+ +
207+ +import "testing"
208+ +
209+ +func TestBar_UnexportedInputParam(t *testing.T) {
210+ + tests := []struct {
211+ + name string // description of this test case
212+ + // Named input parameters for target function.
213+ + in string
214+ + f foo
215+ + want string
216+ + }{
217+ + // TODO: Add test cases.
218+ + }
219+ + for _, tt := range tests {
220+ + t.Run(tt.name, func(t *testing.T) {
221+ + // TODO: construct the receiver type.
222+ + var b Bar
223+ + got := b.UnexportedInputParam(tt.in, tt.f)
224+ + // TODO: update the condition below to compare got with tt.want.
225+ + if true {
226+ + t.Errorf("UnexportedInputParam() = %v, want %v", got, tt.want)
227+ + }
228+ + })
229+ + }
230+ +}
231+ -- @missing_test_file_unexported_function/missingtestfile/missingtestfile_test.go --
232+ @@ -0,0 +1,23 @@
233+ +package main
234+ +
235+ +import "testing"
236+ +
237+ +func Test_unexportedFunction(t *testing.T) {
238+ + tests := []struct {
239+ + name string // description of this test case
240+ + // Named input parameters for target function.
241+ + in string
242+ + want string
243+ + }{
244+ + // TODO: Add test cases.
245+ + }
246+ + for _, tt := range tests {
247+ + t.Run(tt.name, func(t *testing.T) {
248+ + got := unexportedFunction(tt.in)
249+ + // TODO: update the condition below to compare got with tt.want.
250+ + if true {
251+ + t.Errorf("unexportedFunction() = %v, want %v", got, tt.want)
252+ + }
253+ + })
254+ + }
255+ +}
256+ -- @missing_test_file_unexported_recv/missingtestfile/missingtestfile_test.go --
257+ @@ -0,0 +1,25 @@
258+ +package main
259+ +
260+ +import "testing"
261+ +
262+ +func Test_foo_ExportedMethod(t *testing.T) {
263+ + tests := []struct {
264+ + name string // description of this test case
265+ + // Named input parameters for target function.
266+ + in string
267+ + want string
268+ + }{
269+ + // TODO: Add test cases.
270+ + }
271+ + for _, tt := range tests {
272+ + t.Run(tt.name, func(t *testing.T) {
273+ + // TODO: construct the receiver type.
274+ + var f foo
275+ + got := f.ExportedMethod(tt.in)
276+ + // TODO: update the condition below to compare got with tt.want.
277+ + if true {
278+ + t.Errorf("ExportedMethod() = %v, want %v", got, tt.want)
279+ + }
280+ + })
281+ + }
282+ +}
167283-- xpackagetestfile/xpackagetestfile.go --
168284package main
169285
@@ -519,7 +635,7 @@ package main
519635+ t.Run(tt.name, func(t *testing.T) {
520636+ q, err := newQux1()
521637+ if err != nil {
522- + t.Fatalf("could not contruct receiver type: %v", err)
638+ + t.Fatalf("could not construct receiver type: %v", err)
523639+ }
524640+ got := q.method(tt.in)
525641+ // TODO: update the condition below to compare got with tt.want.
@@ -877,7 +993,7 @@ func (*ReturnPtrError) Method(in string) string {return in} //@codeaction("Metho
877993+ t.Run(tt.name, func(t *testing.T) {
878994+ r, err := main.NewReturnTypeError()
879995+ if err != nil {
880- + t.Fatalf("could not contruct receiver type: %v", err)
996+ + t.Fatalf("could not construct receiver type: %v", err)
881997+ }
882998+ got := r.Method(tt.in)
883999+ // TODO: update the condition below to compare got with tt.want.
@@ -938,7 +1054,7 @@ func (*ReturnPtrError) Method(in string) string {return in} //@codeaction("Metho
9381054+ t.Run(tt.name, func(t *testing.T) {
9391055+ r, err := main.NewReturnPtrError()
9401056+ if err != nil {
941- + t.Fatalf("could not contruct receiver type: %v", err)
1057+ + t.Fatalf("could not construct receiver type: %v", err)
9421058+ }
9431059+ got := r.Method(tt.in)
9441060+ // TODO: update the condition below to compare got with tt.want.
@@ -1018,7 +1134,7 @@ func (*Bar) Method(in string) string {return in} //@codeaction("Method", "source
10181134+ t.Run(tt.name, func(t *testing.T) {
10191135+ b, err := main.ABar()
10201136+ if err != nil {
1021- + t.Fatalf("could not contruct receiver type: %v", err)
1137+ + t.Fatalf("could not construct receiver type: %v", err)
10221138+ }
10231139+ got := b.Method(tt.in)
10241140+ // TODO: update the condition below to compare got with tt.want.
@@ -1403,7 +1519,7 @@ var local renamedctx.Context
14031519+ t.Run(tt.name, func(t *testing.T) {
14041520+ f, err := main.NewFoo(renamedctx.Background())
14051521+ if err != nil {
1406- + t.Fatalf("could not contruct receiver type: %v", err)
1522+ + t.Fatalf("could not construct receiver type: %v", err)
14071523+ }
14081524+ got, got2, got3 := f.Method(renamedctx.Background(), "", "")
14091525+ // TODO: update the condition below to compare got with tt.want.
0 commit comments