From 78c0290906c834fad871f984cc033204489643ee Mon Sep 17 00:00:00 2001 From: Abdusalamov Arsen Date: Tue, 17 Jul 2018 18:47:30 +0300 Subject: [PATCH] Skip creating arg for case when only one TestParams ``` tests := []struct { name string arg string }{ // TODO: Add test cases. } for _, tt := range tests { Foo3(tt.arg) } ``` instead of ``` type args struct { s string } tests := []struct { name string args args }{ // TODO: Add test cases. } for _, tt := range tests { Foo3(tt.args.s) } ``` --- internal/render/bindata/bindata.go | 24 ++++++------- internal/render/templates/call.tmpl | 15 +++++++- internal/render/templates/function.tmpl | 12 ++++--- internal/render/templates/inputs.tmpl | 12 ++++++- internal/render/templates/message.tmpl | 9 ++++- internal/render/templates/results.tmpl | 9 ++++- testdata/goldens/custom_importer_fails.go | 21 ++++------- ...ent_packages_in_same_directory_-_part_1.go | 7 ++-- ...ent_packages_in_same_directory_-_part_2.go | 7 ++-- testdata/goldens/empty_test_file.go | 7 ++-- testdata/goldens/existing_test_file.go | 21 ++++------- ...test_file_with_just_package_declaration.go | 7 ++-- ...xisting_test_file_with_multiple_imports.go | 7 ++-- .../existing_test_file_with_no_functions.go | 7 ++-- .../goldens/file_with_multiple_imports.go | 2 +- .../function_returning_only_an_error.go | 7 ++-- ...tion_returning_two_results_and_an_error.go | 9 ++--- .../function_with_a_function_parameter.go | 7 ++-- ...tion_parameter_that_returns_two_results.go | 7 ++-- ...eter_with_its_own_parameters_and_result.go | 7 ++-- .../function_with_a_variadic_parameter.go | 9 ++--- ...ction_with_channel_parameter_and_result.go | 7 ++-- ...ned_interface_type_parameter_and_result.go | 7 ++-- ...interface_receiver_parameter_and_result.go | 7 ++-- ...ed_struct_receiver_parameter_and_result.go | 7 ++-- ...ion_with_interface_parameter_and_result.go | 7 ++-- ...ction_with_map_argument_and_return_type.go | 7 ++-- ...th_multiple_parameters_of_the_same_type.go | 2 +- .../goldens/function_with_named_argument.go | 7 ++-- .../goldens/function_with_named_imports.go | 7 ++-- ...ion_with_slice_argument_and_return_type.go | 9 ++--- ...struct_pointer_argument_and_return_type.go | 7 ++-- ...h_name_receivers_parameters_and_results.go | 36 +++++++------------ testdata/goldens/io_writer_parameters.go | 20 ++++------- .../goldens/method_on_a_struct_pointer.go | 9 ++--- testdata/goldens/multiple_functions.go | 21 ++++------- .../multiple_functions_excluding_on_method.go | 14 +++----- ...ultiple_functions_excluding_on_receiver.go | 14 +++----- .../multiple_functions_filtering_exported.go | 14 +++----- ..._functions_filtering_exported_with_excl.go | 7 ++-- ..._functions_filtering_exported_with_only.go | 9 ++--- ...tiple_functions_with_both_only_and_excl.go | 7 ++-- ...le_functions_with_case-insensitive_excl.go | 7 ++-- ...le_functions_with_case-insensitive_only.go | 14 +++----- .../goldens/multiple_functions_with_excl.go | 7 ++-- .../goldens/multiple_functions_with_only.go | 18 ++++------ ..._functions_with_only_and_excl_competing.go | 7 ++-- ...functions_with_only_filtering_on_method.go | 7 ++-- ...nctions_with_only_filtering_on_receiver.go | 7 ++-- testdata/goldens/multiple_named_results.go | 7 ++-- .../print_inputs_with_single_argument.go | 13 +++---- ..._with_fields_with_complex_package_names.go | 7 ++-- .../struct_receiver_with_anonymous_fields.go | 7 ++-- .../struct_receiver_with_multiple_fields.go | 7 ++-- testdata/goldens/target_test_file.go | 7 ++-- .../goldens/test_file_with_syntax_errors.go | 7 ++-- testdata/goldens/undefined_types.go | 7 ++-- testdata/goldens/underlying_types.go | 7 ++-- .../test_existing_test_file_with_comments.go | 1 + 59 files changed, 211 insertions(+), 364 deletions(-) diff --git a/internal/render/bindata/bindata.go b/internal/render/bindata/bindata.go index 6a0d5f8..be01bdf 100644 --- a/internal/render/bindata/bindata.go +++ b/internal/render/bindata/bindata.go @@ -74,7 +74,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _templatesCallTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x44\x8e\x41\x6a\xc3\x40\x0c\x45\xaf\x22\x8c\x17\x2d\x18\x1d\xa0\xd0\x03\x78\x53\x4a\x5b\xda\xb5\x18\xcb\xae\xc0\x9e\x16\x8d\x92\x10\x84\xee\x1e\xc6\x38\x99\xd5\x87\x3f\x6f\xde\x97\xfb\xc4\xb3\x64\x86\x2e\xd1\xba\x76\x11\xee\x17\xb1\x5f\xc0\x0f\x4e\x2c\x67\xd6\xda\xc8\x0c\xf9\xcf\x00\xc7\xf2\x69\x7a\x4a\x16\x61\x86\xee\x9c\xa7\xfa\x7a\x27\x01\x23\x5a\x8b\x6f\xb4\x71\xc4\x93\xbb\x52\x5e\x18\x7a\x19\xa0\xe7\x15\x5e\x5e\x01\xdf\x49\x69\x63\x63\x2d\x87\xbd\x97\x88\x01\x1e\x7f\xdb\xde\x8f\x8a\xd5\x1b\xcc\x90\x74\x29\x4d\xbf\x2b\xea\xe2\x4e\xe3\xd7\xf5\x9f\x71\x2c\xdf\xa4\x42\x93\xa4\x08\xc4\xc6\xee\xf1\x7c\xe4\x2d\x00\x00\xff\xff\x65\x08\xbc\x88\xf1\x00\x00\x00") +var _templatesCallTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\x41\x4b\x03\x41\x0c\x85\xef\xfd\x15\x8f\xb2\x87\x16\xda\x80\x57\xc1\x1f\xd0\x8b\x88\x16\x3d\x0f\xbb\x69\x0d\x6c\xa7\x92\x89\x8a\x84\xfc\x77\x99\xc5\x6e\xb7\x58\x3d\x26\xef\x7d\x6f\x5e\xc6\xbd\xe3\x9d\x64\xc6\xbc\x4d\x7d\x3f\x8f\x98\x01\x80\xfb\x1a\x9f\x62\xaf\xa0\x47\x6e\x59\x3e\x58\xb1\xfe\x91\x4e\xb2\xec\x90\x8f\x06\xda\x94\x27\xd3\xf7\xd6\x10\x61\x46\xee\xe0\xdc\xfd\x32\x8f\x29\x84\x08\x1a\x9f\x98\x5a\xeb\x4c\xf7\xe9\xc0\x75\xb3\x18\x57\x4d\x9f\x71\x7b\x87\x9e\x33\x68\xcb\xc5\x1e\x92\xa6\x03\x1b\x6b\xb9\x20\x35\xe5\x3d\xa3\x91\x15\x1a\xee\x2b\x40\x57\x8c\x93\xea\x8d\x44\xac\xe0\x7e\xad\xec\xf9\xb2\x17\x15\x63\x1d\x0e\x4b\xba\x77\xaf\x0a\x0f\x95\x6e\x22\x0a\x0d\x78\xc4\x9f\x29\x38\xea\x39\x05\x8b\x13\xba\xac\x5e\xf7\xa1\x20\xe8\x1f\x9e\xb6\x5f\x6f\x4c\x9b\xf2\x9c\x54\x52\x27\x6d\x04\x11\x5d\xba\x27\xbf\xb8\x9c\x4d\x86\xef\x00\x00\x00\xff\xff\x97\x71\xbb\x81\xd7\x01\x00\x00") func templatesCallTmplBytes() ([]byte, error) { return bindataRead( @@ -89,12 +89,12 @@ func templatesCallTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/call.tmpl", size: 241, mode: os.FileMode(420), modTime: time.Unix(1479275664, 0)} + info := bindataFileInfo{name: "templates/call.tmpl", size: 471, mode: os.FileMode(436), modTime: time.Unix(1531841950, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templatesFunctionTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\x4d\x4f\xe3\x3a\x14\x5d\x27\xbf\xe2\x52\x01\x6a\x9f\x8a\xd9\x17\x75\xf1\x10\xbc\xa7\xb7\x78\x74\x54\xd0\xb0\x18\x8d\x46\x26\xbd\xe9\x58\xe3\x3a\x1d\xfb\x06\x54\x59\xfe\xef\x23\x3b\xce\x67\x53\x86\xcd\xb0\x20\xc9\xf5\xc7\x39\x3e\xf7\x1c\x83\xb5\x1b\xcc\x85\x42\x98\xe4\xa5\xca\x48\x14\x6a\xe2\x5c\x6a\xed\x15\x9c\xe7\xb0\x58\x02\x73\x2e\x4d\xfd\x10\x58\xcb\x9e\xd0\xd0\x03\xdf\xa1\x73\x53\x82\xbf\x08\x0d\x09\xb5\x65\x4f\x33\xb0\x69\xe2\x97\xbc\x09\xfa\x0e\x6c\x8d\x19\x8a\x57\xd4\xce\xa5\x49\x28\x8b\x1c\xd8\x7f\xe6\x91\x74\x99\x51\x28\x36\xd5\x7f\x04\xca\x8d\xa9\x6a\x09\x1d\xf6\x08\x79\xa8\x80\x09\x93\xfd\xbe\x71\xb6\xe6\x6a\x8b\x83\x05\x89\xb5\xe1\xdb\x93\x0c\xf4\x0e\x7b\x8c\x43\x7e\x09\xaa\x4d\xfc\x6a\x30\xeb\x52\xe7\x7d\xf0\xea\x59\xf9\x63\x7e\xe2\x9a\xef\x90\x50\x07\xb0\x40\x8d\xeb\x6d\x8f\x58\x87\xd6\xf1\x8a\x00\x18\x4a\x47\xec\x3a\x88\x7d\x7c\x2f\xa8\xf1\xa2\x7f\xf9\xda\x81\x51\x7c\x87\x1e\x56\xa8\x6d\x5c\x3c\x22\x73\xcd\x9d\xab\x4d\xab\xf5\x40\xae\x28\x6d\xf5\x68\x14\x91\xa6\xd5\xac\xde\xf2\x58\xd0\x13\xe2\xbd\x23\x59\x92\x04\xbd\xfc\xaf\x91\x35\x1d\xdd\xd6\x68\x4a\x49\xa6\xc6\x79\xe6\x8a\xde\x93\xac\x81\x5c\x23\x95\x5a\x99\x7b\xad\x8b\xa8\xc1\x1b\x57\x74\xaf\x35\xbc\x14\x85\x1c\xe8\xec\x85\xbc\xbe\x86\xa7\xd5\xdd\x6a\x01\x7f\x6f\x36\xe0\xb5\x86\x8c\x1b\x34\x2c\xb4\x21\x2f\x34\x58\x2b\x72\x50\x05\x79\x05\x1f\xf8\x0f\xdc\x38\x07\xdf\xe6\x40\xe4\x7b\x62\x6d\xd8\x2b\x32\xaf\x5a\x65\x53\x88\x3f\x35\xa9\xc7\xf2\xa5\x1a\x72\x8e\xd8\xba\x54\x53\x22\xe6\x1b\x38\x07\x9f\xa1\x61\x6a\x20\x52\x84\xab\x56\xe5\xb1\xe6\x9e\x48\xd1\x51\xcb\x02\xcd\xd0\x8e\xc3\x1e\xc3\x64\xae\x9d\xbb\x8c\xd4\xa3\xa0\xec\x33\x97\x25\x3a\x67\xeb\x2d\x4e\x84\x2b\xb1\x96\x55\x61\x5f\x00\x11\xab\x6c\xc3\x3a\x91\x9b\xb7\x1b\xb4\x51\x4b\x46\xf2\x77\xf4\x11\xf1\x46\x12\x53\x1f\xf3\x59\x0b\x6a\x4e\xdf\x4b\xd2\x62\x09\x97\x2f\x07\x42\xc3\x6e\xcb\x3c\x47\x6d\x3f\x02\x18\x93\x31\x0d\xcd\x5d\x29\x79\xe8\x9a\x67\x76\x5c\x5f\x29\x0c\x2a\xcd\xa0\x61\x46\xb8\xdb\x4b\x4e\x08\x13\x5d\x19\x76\x02\xe7\x79\xb0\x69\x3b\x92\x71\x29\xab\xf2\x29\x16\x23\xae\x4d\x44\x1e\xbb\x36\x24\xe6\x1c\xa0\xd6\x55\x57\xc7\x40\x6e\x1a\x53\x4e\xfd\xbc\xb3\x25\x28\x21\x67\xfe\x49\xc4\xea\x30\xc4\x36\x13\x0b\x5b\xe6\xd3\x49\x77\xaf\x1d\x1a\xc3\xb7\x18\x8f\x82\x7e\x06\x2c\xe1\xe2\x75\x0e\xf5\xf2\x8b\xd7\xc9\xbc\x07\x2f\xd4\xbe\x6c\x0e\x8f\x5a\xcf\x3b\x60\xb3\xd6\x11\xf5\xa5\xd0\x4b\x77\x18\x1b\xc4\x44\x87\x03\x5b\x5b\x5d\x44\x59\xa1\x48\xa8\x12\xe3\xc1\xc6\x1c\xf6\xae\xa5\x8e\x21\x4f\x79\x2a\xa8\xfe\x6f\x41\x6d\x70\x1a\x8f\xb1\xc7\x70\xdb\x4e\x67\x37\x9d\x29\x95\xaa\xdd\xfb\xa9\xf5\x9d\x34\x18\x31\x6e\xb9\x11\x59\xe7\xef\x50\xd3\xdc\xf3\x7c\xcc\x5f\x3e\x94\x3d\x0e\x5d\x9d\xa5\x50\x38\x6c\xf4\x87\xf9\xfc\x21\xfc\x33\x8d\xb9\xc4\x8c\xd8\x1d\xe2\xfe\xfe\x67\xc9\xe5\xb4\xd9\x61\xde\x27\x34\xeb\x32\x6a\xba\xf7\x11\x1f\xd6\x84\x23\xd9\xff\x4b\x49\x62\x2f\x7b\x64\x23\x9f\xd6\xab\xbf\x31\xea\x49\x92\xa7\xff\x3f\x18\xf8\x14\xfc\x81\xba\xd7\xb5\x4b\x5d\x9a\xd6\x3e\xfd\x15\x00\x00\xff\xff\x12\xba\x7c\xa5\x47\x09\x00\x00") +var _templatesFunctionTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\xc1\x8e\xdb\x36\x10\x3d\x4b\x5f\x31\x31\x36\x81\x54\x38\x0c\x7a\xdd\xc0\x87\x06\xd9\x16\x3d\x34\x2e\xbc\x8b\xe6\x50\x14\x05\x57\x1e\xb9\x44\x69\xca\x25\x47\x1b\x18\x04\xff\xbd\x20\x45\x49\x94\x2c\x6f\x7d\xa9\x0e\x2b\x71\x38\x9c\x79\xf3\xe6\x0d\xd7\xd6\xee\xb1\x16\x0a\x61\x55\xb7\xaa\x22\xd1\xa8\x95\x73\xb9\xb5\xef\xe1\xae\x86\xfb\x0d\x30\xe7\xf2\xdc\x6f\x81\xb5\xec\x09\x0d\x7d\xe1\x47\x74\xae\x20\xf8\x8e\xd0\x90\x50\x07\xf6\x54\x82\xcd\x33\x7f\xe4\x9b\xa0\xbf\x80\xed\xb0\x42\xf1\x82\xda\xb9\x3c\x0b\x66\x51\x03\xfb\xd9\x3c\x92\x6e\x2b\x0a\xc6\xc1\xfa\xa3\x40\xb9\x37\x9d\x2d\xa3\xf3\x09\xa1\x0e\x16\x30\xc1\xd9\xc7\x8d\xde\x9a\xab\x03\xce\x0e\x64\xd6\x86\xb5\x07\x19\xe0\x9d\x4f\x18\xb7\xfc\x11\x54\xfb\xb8\x1a\x72\xf6\xa6\xe4\x7b\xf6\x29\x6a\x38\x10\x14\x12\x15\x84\x72\x7f\xe5\x9a\x1f\x91\x50\x9b\x12\xbe\xf7\x4e\x01\x25\xd7\x87\x09\xc6\x04\xe1\xf4\xd0\x00\x27\x98\x2e\x80\x26\xc9\xa7\x50\x3c\xb7\xc6\xf3\xff\xfb\x1f\x49\x1a\xc5\x8f\xe8\xd3\x0a\x75\x88\x87\x17\x18\xef\xcb\xe0\x6a\x3f\xd2\x3e\x63\x2e\xb2\xdc\xbd\x06\x72\xa4\x19\xe9\xeb\x43\x5e\x72\xbb\xcc\x23\xc4\xe7\x26\x0e\xb3\x2c\x10\xe8\xff\xe4\x63\x6e\x08\x5b\x5d\x88\x6b\x64\x42\xf2\x70\x7d\x48\x90\x8d\xf6\x05\x80\x30\x2c\x92\xc0\x3b\x34\xad\x24\xd3\x57\xf5\x95\x2b\x7a\xad\x41\x83\x68\x77\x48\xad\x56\xe6\x41\xeb\x26\x32\xfe\x8d\x2b\x7a\xd0\x1a\x9e\x9b\x46\xce\xba\x6a\x07\x60\x1f\x3e\xc0\xd3\xf6\xf3\xf6\x1e\x7e\xd8\xef\xc1\xf7\x17\x2a\x6e\xd0\xb0\xd0\xfa\xba\xd1\x60\xad\xa8\x41\x35\xe4\xbb\xf6\x85\xff\x8d\x7b\xe7\xe0\xcf\x35\x10\x79\x1d\x58\x1b\x22\x46\xfc\x9d\x3c\xec\x9c\x75\xf6\xd8\x3e\x77\x5b\xce\x11\xdb\xb5\xaa\x20\x62\x5e\x34\x6b\xf0\x23\x3c\x1f\xda\x9e\x29\x78\x3f\x76\x76\x49\x50\x57\x86\xf8\x42\x26\x01\xa6\xf7\xf3\xf4\x05\x67\xae\x9d\x7b\x17\xa1\x47\x5a\xd9\x6f\x5c\xb6\xe8\x9c\xed\x43\x5c\x99\xed\xcc\x5a\xd6\xdd\x35\xf7\x40\xc4\x3a\xa9\xb2\x64\xe2\xd7\x63\x80\x71\xd2\xb3\x85\xf1\xbf\x58\xc4\x7c\x0b\x53\xda\x97\xf9\x55\x0b\x1a\xaa\x9f\x4c\xef\xfd\x06\xde\x3d\x9f\x09\x0d\xfb\xd4\xd6\x35\x6a\x7b\x4b\xc2\x38\x8d\x45\x68\xee\x56\xc9\x73\x2a\xa1\xf2\xd2\xbe\x55\x18\x58\x2a\x61\x40\x46\x78\x3c\x49\x4e\x08\x2b\xdd\xc9\x76\x05\x77\x75\x10\xeb\xb8\x53\x71\x29\x3b\xf3\x35\x14\x0b\xda\xcd\x44\x1d\xbb\x36\x07\xe6\x1c\xa0\xd6\x5d\x57\x97\x92\x7c\x1c\x44\x59\x78\xbf\x37\x1b\x50\x42\x96\xfe\x4d\xc4\xfa\x91\x88\x6d\x26\x16\x42\xd6\xc5\x2a\x8d\x75\x44\x63\xf8\x01\x63\x29\xe8\x3d\x60\x03\x6f\x5f\xd6\xd0\x1f\x7f\xfb\xb2\x5a\x4f\xd2\x0b\x75\x6a\x87\xe2\x51\xeb\x75\x92\xac\x1c\x15\x11\x54\x38\x9f\xf1\xb0\x37\x1b\x13\x1d\x0a\xb6\xb6\xbb\xfc\xaa\x46\x91\x50\x2d\xc6\xc2\x96\x14\xf6\xaa\xa4\x2e\x53\x5e\xd3\x54\x60\xfd\xa7\x86\xc6\xc1\x19\x34\xc6\x1e\xc3\x0d\x5f\x94\x1f\x13\x97\x8e\xd5\xf4\x96\x1a\x75\xe7\xef\xce\x2e\xc7\x27\x6e\x44\x95\xfc\x1b\x1c\x9a\x7b\x57\x2f\xe9\xcb\x0f\xe5\x04\x43\xca\xb3\x14\x0a\xe7\x8d\xbe\x19\xcf\xff\x94\xff\x8d\xc6\x5a\x62\x45\xec\x33\xe2\xe9\xe1\x9f\x96\xcb\x62\x88\xb0\x9e\x02\x2a\x53\x44\x43\xf7\x6e\xd1\x61\x0f\x38\x82\xfd\xa5\x95\x24\x4e\x72\x02\x36\xe2\x19\xb5\xfa\x1f\x42\xbd\x0a\xf2\xfa\xcf\x93\x99\x4e\xc1\x17\x94\x5e\xd7\x2e\x77\x79\xde\xeb\xf4\xdf\x00\x00\x00\xff\xff\x7e\x2c\x20\xd8\xc6\x09\x00\x00") func templatesFunctionTmplBytes() ([]byte, error) { return bindataRead( @@ -109,7 +109,7 @@ func templatesFunctionTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/function.tmpl", size: 2375, mode: os.FileMode(420), modTime: time.Unix(1479275664, 0)} + info := bindataFileInfo{name: "templates/function.tmpl", size: 2502, mode: os.FileMode(436), modTime: time.Unix(1531841722, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -129,7 +129,7 @@ func templatesHeaderTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/header.tmpl", size: 140, mode: os.FileMode(420), modTime: time.Unix(1486648034, 0)} + info := bindataFileInfo{name: "templates/header.tmpl", size: 140, mode: os.FileMode(436), modTime: time.Unix(1531821310, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -149,12 +149,12 @@ func templatesInlineTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/inline.tmpl", size: 49, mode: os.FileMode(420), modTime: time.Unix(1479275664, 0)} + info := bindataFileInfo{name: "templates/inline.tmpl", size: 49, mode: os.FileMode(436), modTime: time.Unix(1531821310, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templatesInputsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x4c\x8d\x31\x0a\x02\x41\x0c\x45\xaf\x12\x96\x2d\x25\x07\x10\x3c\x80\x9d\xe0\x09\x22\x9b\x59\xa6\xd8\x28\x99\x6c\xf5\xc9\xdd\x65\x46\x8b\xa9\x12\x1e\xff\xbf\x0f\x6c\x5a\xaa\x29\x2d\xd5\x3e\x67\xb4\x25\x13\x58\x0b\x5d\x6f\xc4\xfd\xad\x85\xec\x1d\xc4\xcf\xf3\x15\xda\xa2\x65\x46\xb0\xc9\xa1\x17\x02\xd4\xb6\x7f\x66\x2d\xfc\xf0\x6a\x71\x1f\x92\x0e\x5d\x6c\xd7\xc1\xc5\xe5\xd0\x50\xff\x75\xc5\xf7\xc6\xc0\xa0\x7d\x62\xf2\xcc\xe7\x1b\x00\x00\xff\xff\x8e\xbc\xcf\xda\x98\x00\x00\x00") +var _templatesInputsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\xc1\x0a\xc2\x30\x10\x44\xef\x7e\xc5\x50\x7a\x50\x68\x03\x5e\x05\x3f\xc0\x9b\xa0\x3f\x10\xe9\xa6\x04\xda\x55\x93\xed\x69\xe9\xbf\x4b\x53\xaa\xa9\x9a\x53\xb2\xf3\xb2\x33\xa3\xda\x90\xf3\x4c\x28\x3c\x3f\x06\x89\x05\xea\x71\xdc\x00\x80\x6a\x8d\xd2\xe1\x70\x84\x59\xcd\xbc\x03\xdf\x05\xe6\x32\xdc\x84\xa2\xc4\x49\x14\x31\x6c\x7b\xaa\xa0\x4a\xdc\x7c\xe3\xa5\x33\xe7\xe0\x59\x4e\xc9\xe1\xad\x2e\x44\xb0\xdc\x52\x82\x6c\xb0\x3d\x09\x85\x98\x11\xd9\x1e\x7a\x62\xdb\x11\x4f\xe8\x95\xa2\x7c\xf0\x1d\xf6\x48\x21\x6c\x68\x53\x86\x2e\xd2\xca\x66\x39\x33\x12\x8d\x6a\xfa\x3c\x37\xab\x7e\xbc\xf2\x0e\xff\x66\xf9\x3b\xbb\xbf\x02\x00\x00\xff\xff\xdc\xe5\x6f\xe4\x4c\x01\x00\x00") func templatesInputsTmplBytes() ([]byte, error) { return bindataRead( @@ -169,12 +169,12 @@ func templatesInputsTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/inputs.tmpl", size: 152, mode: os.FileMode(420), modTime: time.Unix(1479275664, 0)} + info := bindataFileInfo{name: "templates/inputs.tmpl", size: 332, mode: os.FileMode(436), modTime: time.Unix(1531841923, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templatesMessageTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x3c\x8d\xe1\x6a\x83\x40\x10\x84\xff\xfb\x14\x8b\x28\xb4\xa0\xfb\x00\x85\x3e\x40\xff\x14\x69\x4b\xff\x5f\xe2\x68\x16\xf4\x62\xee\x4e\x43\x58\xf6\xdd\x83\x07\xf1\xd7\x0c\x33\xc3\x37\xaa\x3d\x06\xf1\xa0\x72\x46\x8c\x6e\x44\x49\xad\x59\xa1\x2a\x03\xf9\x6b\x22\xfe\x5d\x4f\x09\x31\x45\xb3\xfa\xc6\xa4\x0a\xdf\x9b\xa9\xde\x25\x5d\x88\x7f\x70\x86\x6c\x08\x7b\xc2\x7f\x8f\x05\xfc\xef\xa6\x15\x66\x7c\x0c\xf9\xdb\xcd\x30\x7b\xcb\x44\xee\x82\xf8\xf4\xe5\x97\x75\x07\xaa\x06\xe7\x47\x50\x25\x0d\x55\x98\xe8\xe3\x93\xb8\x73\xc1\xcd\x48\x08\xb9\x97\x81\x2a\x31\x6b\x5e\xbf\xf5\x76\x70\xb3\xbc\x17\xaa\x2d\x65\xfb\x0c\x00\x00\xff\xff\x90\x2e\xb9\x52\xc9\x00\x00\x00") +var _templatesMessageTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x8e\x51\x4a\xc4\x40\x10\x44\xff\xf7\x14\xc5\x92\x05\x85\xdd\x3e\x80\xe0\x01\xfc\x91\x45\xc5\xff\xd1\x54\xd6\x86\xcd\x18\x67\x26\x11\x69\xfa\xee\x62\x48\x42\x82\x7f\x5d\x54\x75\xd5\x33\xab\xd9\x68\x24\xf6\x2d\x73\x0e\x17\xee\x71\x72\xdf\x01\x80\xd9\x09\xda\x20\x7e\x16\xc8\x73\xff\x56\x98\x4b\x76\x3f\x7c\x09\xcc\x18\xeb\x55\xea\x5b\xcb\x07\xe4\x89\xef\xd4\x81\x69\x29\x98\x6d\x79\xf9\xe9\x28\xaf\xe1\xda\xf3\xcf\x93\xe5\x8f\xb1\xde\xac\xc9\x63\x68\xc7\xc8\xcd\x1a\x40\xce\x49\x63\x79\x88\x5d\x5f\xf2\xbf\xee\x14\xe2\x85\xa8\xf4\x88\x8a\x57\xdc\xdd\x43\xce\x21\x85\x96\x85\x29\xbb\x9b\x69\x83\x4a\xdd\x8f\x33\xf3\x61\x18\x8f\xcd\xec\xa4\x6f\x77\x93\x70\xff\x0d\x00\x00\xff\xff\x73\x78\xe6\xa5\x16\x01\x00\x00") func templatesMessageTmplBytes() ([]byte, error) { return bindataRead( @@ -189,12 +189,12 @@ func templatesMessageTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/message.tmpl", size: 201, mode: os.FileMode(420), modTime: time.Unix(1479275664, 0)} + info := bindataFileInfo{name: "templates/message.tmpl", size: 278, mode: os.FileMode(436), modTime: time.Unix(1531831084, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templatesResultsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x8d\x4d\x0a\xc2\x40\x0c\x85\xaf\xf2\x28\xb3\x2c\x3d\x80\xe0\x52\xdc\x7b\x03\xa1\x19\x09\x94\x0c\xbc\x99\xae\x42\xee\x2e\xa9\x45\xc1\x55\x7e\xbe\x2f\x79\xee\xab\x54\x35\xc1\x44\xe9\xfb\x36\xfa\x14\x01\x77\x3e\xed\x25\x28\x3a\xa3\xc8\x86\xcb\x15\xcb\xe3\x83\x23\xdc\xb5\xa2\x68\xc4\x0c\x77\xb1\x35\x37\xf7\x36\xb0\x64\x73\xce\x5a\xf3\x60\xec\xb4\x7e\x23\x1b\x53\x16\xf2\xe4\x38\x84\xc6\xef\xd3\x7f\x39\x03\x7f\xee\x51\xdf\x01\x00\x00\xff\xff\xb0\x4f\xcf\x61\xa8\x00\x00\x00") +var _templatesResultsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x8e\xc1\x0a\xc2\x30\x10\x44\xef\x7e\xc5\x50\x72\x6c\xf3\x01\x82\x47\xf1\xde\x3f\x10\xba\x95\x40\x49\x60\x92\x9e\x96\xfd\x77\x09\x46\x1b\xf5\x3a\xfb\xe6\xed\xa8\x2e\xb2\x86\x28\x18\x28\x79\xdf\x4a\x1e\xcc\x4e\x00\xa0\x3a\x81\xf7\xf8\x10\xb8\x30\xc2\xc9\x86\xf3\x05\x7e\x7e\x41\x98\x1a\xf5\x26\xc3\x0a\x17\xcc\x46\xa8\x4a\x5c\xfe\xce\xb7\x54\xe0\x3f\x69\x4d\x7a\xaa\x09\xfc\x2c\x65\x67\xcc\x57\x32\xb1\xba\x84\xfc\xd6\x35\x30\xf1\x18\xf2\x53\xaa\x23\x8f\x4e\xf7\xe8\x19\x00\x00\xff\xff\x5d\x27\xa2\xc4\xe8\x00\x00\x00") func templatesResultsTmplBytes() ([]byte, error) { return bindataRead( @@ -209,7 +209,7 @@ func templatesResultsTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/results.tmpl", size: 168, mode: os.FileMode(420), modTime: time.Unix(1479275664, 0)} + info := bindataFileInfo{name: "templates/results.tmpl", size: 232, mode: os.FileMode(436), modTime: time.Unix(1531831164, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/internal/render/templates/call.tmpl b/internal/render/templates/call.tmpl index a41b159..fd17a80 100644 --- a/internal/render/templates/call.tmpl +++ b/internal/render/templates/call.tmpl @@ -1 +1,14 @@ -{{define "call"}}{{with .Receiver}}{{if not .IsStruct}}tt.{{end}}{{Receiver .}}.{{end}}{{.Name}}({{range $i, $el := .Parameters}}{{if $i}}, {{end}}{{if not .IsWriter}}tt.args.{{end}}{{Param .}}{{if .Type.IsVariadic}}...{{end}}{{end}}){{end}} \ No newline at end of file +{{define "call"}} + {{- with .Receiver -}} + {{- if not .IsStruct }}tt.{{ end -}} + {{- Receiver . }}. + {{- end -}} + {{- .Name -}}( + {{- $ln := len .TestParameters -}} + {{- range $i, $el := .Parameters -}} + {{- if $i}}, {{end -}} + {{- if not .IsWriter}}tt.arg{{if ne $ln 1}}s.{{end}}{{end -}} + {{- if or .IsWriter (ne $ln 1) -}}{{Param .}}{{end -}} + {{- if .Type.IsVariadic}}...{{end -}} + {{- end -}}) +{{- end -}} \ No newline at end of file diff --git a/internal/render/templates/function.tmpl b/internal/render/templates/function.tmpl index fa1e59c..416df4e 100644 --- a/internal/render/templates/function.tmpl +++ b/internal/render/templates/function.tmpl @@ -13,7 +13,7 @@ func {{.TestName}}(t *testing.T) { {{- end}} {{- end}} {{- end}} - {{- if .TestParameters}} + {{- if gt (len .TestParameters) 1}} type args struct { {{- range .TestParameters}} {{Param .}} {{.Type}} @@ -29,9 +29,13 @@ func {{.TestName}}(t *testing.T) { {{Receiver .}} {{.Type}} {{- end}} {{- end}} - {{- if .TestParameters}} + {{- if gt (len .TestParameters) 1}} args args - {{- end}} + {{- else }} + {{- range .TestParameters}} + arg {{.Type}} + {{- end}} + {{- end }} {{- range .TestResults}} {{Want .}} {{.Type}} {{- end}} @@ -39,7 +43,7 @@ func {{.TestName}}(t *testing.T) { wantErr bool {{- end}} }{ - // TODO: Add test cases. + // TODO: Add test cases. } for {{if not .IsNaked}} _, tt := {{end}} range tests { {{- if .Subtests }}t.Run(tt.name, func(t *testing.T) { {{- end -}} diff --git a/internal/render/templates/inputs.tmpl b/internal/render/templates/inputs.tmpl index 2ab0994..849a628 100644 --- a/internal/render/templates/inputs.tmpl +++ b/internal/render/templates/inputs.tmpl @@ -1 +1,11 @@ -{{define "inputs"}}{{$f := .}}{{if not .Subtests}}tt.name, {{end}}{{if $f.PrintInputs}}{{range $f.Parameters}}tt.args.{{Param .}}, {{end}}{{end}}{{end}} \ No newline at end of file +{{define "inputs" -}} + {{- $f := . -}} + {{- if not .Subtests -}}tt.name, {{end -}} + {{- if $f.PrintInputs -}} + {{- range $f.Parameters}} + {{- if eq (len $f.TestParameters) 1 }}tt.arg, {{else -}} + tt.args.{{Param . -}}, + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} \ No newline at end of file diff --git a/internal/render/templates/message.tmpl b/internal/render/templates/message.tmpl index a5ef2fa..304ab92 100644 --- a/internal/render/templates/message.tmpl +++ b/internal/render/templates/message.tmpl @@ -1,3 +1,10 @@ {{define "message" -}} -{{if not .Subtests}}%q. {{end}}{{with .Receiver}}{{.Type.Value}}.{{end}}{{.Name}}({{if .PrintInputs}}{{range $i, $el := .Parameters}}{{if $i}}, {{end}}%v{{end}}{{end}}) + {{- if not .Subtests}}%q. {{end}} + {{- with .Receiver -}} + {{- .Type.Value -}}. + {{- end -}} + {{- .Name -}}( + {{- if .PrintInputs -}} + {{- range $i, $el := .Parameters}}{{if $i}}, {{end}}%v{{end -}} + {{- end -}}) {{- end}} \ No newline at end of file diff --git a/internal/render/templates/results.tmpl b/internal/render/templates/results.tmpl index 2a8c761..e1c105f 100644 --- a/internal/render/templates/results.tmpl +++ b/internal/render/templates/results.tmpl @@ -1 +1,8 @@ -{{define "results"}} {{range $i, $el := .Results}}{{if $i}}, {{end}}{{Got .}}{{end}}{{if .ReturnsError}}, err{{end}} {{if or .Results .ReturnsError}} := {{end}} {{end}} \ No newline at end of file +{{define "results"}} + {{- range $i, $el := .Results -}} + {{- if $i}}, {{end -}} + {{- Got . -}} + {{- end -}} + {{- if .ReturnsError}}, err{{end -}} + {{- if or .Results .ReturnsError}} := {{end -}} +{{- end -}} \ No newline at end of file diff --git a/testdata/goldens/custom_importer_fails.go b/testdata/goldens/custom_importer_fails.go index 71296f3..8352892 100644 --- a/testdata/goldens/custom_importer_fails.go +++ b/testdata/goldens/custom_importer_fails.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,38 +27,32 @@ func TestFooFilter(t *testing.T) { } func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } } func Test_bazFilter(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ // TODO: Add test cases. } for _, tt := range tests { - if got := bazFilter(tt.args.f); got != tt.want { + if got := bazFilter(tt.arg); got != tt.want { t.Errorf("%q. bazFilter() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/different_packages_in_same_directory_-_part_1.go b/testdata/goldens/different_packages_in_same_directory_-_part_1.go index de9d8c7..9331717 100644 --- a/testdata/goldens/different_packages_in_same_directory_-_part_1.go +++ b/testdata/goldens/different_packages_in_same_directory_-_part_1.go @@ -6,13 +6,10 @@ func TestBar_Bar(t *testing.T) { type fields struct { Foo string } - type args struct { - s string - } tests := []struct { name string fields fields - args args + arg string wantErr bool }{ // TODO: Add test cases. @@ -21,7 +18,7 @@ func TestBar_Bar(t *testing.T) { b := &Bar{ Foo: tt.fields.Foo, } - if err := b.Bar(tt.args.s); (err != nil) != tt.wantErr { + if err := b.Bar(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.Bar() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/different_packages_in_same_directory_-_part_2.go b/testdata/goldens/different_packages_in_same_directory_-_part_2.go index 4d7f2c0..ad63f5e 100644 --- a/testdata/goldens/different_packages_in_same_directory_-_part_2.go +++ b/testdata/goldens/different_packages_in_same_directory_-_part_2.go @@ -6,13 +6,10 @@ func TestFoo_Foo(t *testing.T) { type fields struct { Bar string } - type args struct { - s string - } tests := []struct { name string fields fields - args args + arg string wantErr bool }{ // TODO: Add test cases. @@ -21,7 +18,7 @@ func TestFoo_Foo(t *testing.T) { f := &Foo{ Bar: tt.fields.Bar, } - if err := f.Foo(tt.args.s); (err != nil) != tt.wantErr { + if err := f.Foo(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Foo.Foo() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/empty_test_file.go b/testdata/goldens/empty_test_file.go index 0d4d7de..7107e91 100644 --- a/testdata/goldens/empty_test_file.go +++ b/testdata/goldens/empty_test_file.go @@ -6,18 +6,15 @@ import ( ) func TestNot(t *testing.T) { - type args struct { - this *os.File - } tests := []struct { name string - args args + arg *os.File want string }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Not(tt.args.this); got != tt.want { + if got := Not(tt.arg); got != tt.want { t.Errorf("%q. Not() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/existing_test_file.go b/testdata/goldens/existing_test_file.go index f671f3e..7107f8b 100644 --- a/testdata/goldens/existing_test_file.go +++ b/testdata/goldens/existing_test_file.go @@ -46,19 +46,16 @@ func TestBaz100(t *testing.T) { } func TestFoo100(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := Foo100(tt.args.strs) + got, err := Foo100(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Foo100() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -70,38 +67,32 @@ func TestFoo100(t *testing.T) { } func TestBar_Bar100(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.Bar100(tt.args.i); (err != nil) != tt.wantErr { + if err := b.Bar100(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.Bar100() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } } func Test_baz100(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ // TODO: Add test cases. } for _, tt := range tests { - if got := baz100(tt.args.f); got != tt.want { + if got := baz100(tt.arg); got != tt.want { t.Errorf("%q. baz100() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/existing_test_file_with_just_package_declaration.go b/testdata/goldens/existing_test_file_with_just_package_declaration.go index 63421fe..6163f7a 100644 --- a/testdata/goldens/existing_test_file_with_just_package_declaration.go +++ b/testdata/goldens/existing_test_file_with_just_package_declaration.go @@ -3,18 +3,15 @@ package testdata import "testing" func TestFoo101(t *testing.T) { - type args struct { - s string - } tests := []struct { name string - args args + arg string want string }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo101(tt.args.s); got != tt.want { + if got := Foo101(tt.arg); got != tt.want { t.Errorf("%q. Foo101() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/existing_test_file_with_multiple_imports.go b/testdata/goldens/existing_test_file_with_multiple_imports.go index 3329bc4..b6d4cfb 100644 --- a/testdata/goldens/existing_test_file_with_multiple_imports.go +++ b/testdata/goldens/existing_test_file_with_multiple_imports.go @@ -23,18 +23,15 @@ func TestFoo200(t *testing.T) { } func TestBar200(t *testing.T) { - type args struct { - t types.Type - } tests := []struct { name string - args args + arg types.Type want string }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Bar200(tt.args.t); got != tt.want { + if got := Bar200(tt.arg); got != tt.want { t.Errorf("%q. Bar200() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/existing_test_file_with_no_functions.go b/testdata/goldens/existing_test_file_with_no_functions.go index 42dcd79..c0f6bb3 100644 --- a/testdata/goldens/existing_test_file_with_no_functions.go +++ b/testdata/goldens/existing_test_file_with_no_functions.go @@ -8,18 +8,15 @@ import ( var example102 = fmt.Sprintf("test%v", 1) func TestFoo102(t *testing.T) { - type args struct { - s string - } tests := []struct { name string - args args + arg string want string }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo102(tt.args.s); got != tt.want { + if got := Foo102(tt.arg); got != tt.want { t.Errorf("%q. Foo102() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/file_with_multiple_imports.go b/testdata/goldens/file_with_multiple_imports.go index c0eac65..da6086d 100644 --- a/testdata/goldens/file_with_multiple_imports.go +++ b/testdata/goldens/file_with_multiple_imports.go @@ -18,7 +18,7 @@ func TestFoo24(t *testing.T) { args args wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { if err := Foo24(tt.args.r, tt.args.x, tt.args.t); (err != nil) != tt.wantErr { diff --git a/testdata/goldens/function_returning_only_an_error.go b/testdata/goldens/function_returning_only_an_error.go index 3277fc0..6253d7c 100644 --- a/testdata/goldens/function_returning_only_an_error.go +++ b/testdata/goldens/function_returning_only_an_error.go @@ -3,18 +3,15 @@ package testdata import "testing" func TestFoo12(t *testing.T) { - type args struct { - str string - } tests := []struct { name string - args args + arg string wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - if err := Foo12(tt.args.str); (err != nil) != tt.wantErr { + if err := Foo12(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Foo12() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/function_returning_two_results_and_an_error.go b/testdata/goldens/function_returning_two_results_and_an_error.go index b84dd96..71fdb25 100644 --- a/testdata/goldens/function_returning_two_results_and_an_error.go +++ b/testdata/goldens/function_returning_two_results_and_an_error.go @@ -6,20 +6,17 @@ import ( ) func TestFoo25(t *testing.T) { - type args struct { - in0 interface{} - } tests := []struct { name string - args args + arg interface{} want string want1 []byte wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - got, got1, err := Foo25(tt.args.in0) + got, got1, err := Foo25(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Foo25() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/function_with_a_function_parameter.go b/testdata/goldens/function_with_a_function_parameter.go index 245f146..5ec63fa 100644 --- a/testdata/goldens/function_with_a_function_parameter.go +++ b/testdata/goldens/function_with_a_function_parameter.go @@ -3,18 +3,15 @@ package testdata import "testing" func TestFoo13(t *testing.T) { - type args struct { - f func() - } tests := []struct { name string - args args + arg func() wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - if err := Foo13(tt.args.f); (err != nil) != tt.wantErr { + if err := Foo13(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Foo13() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/function_with_a_function_parameter_that_returns_two_results.go b/testdata/goldens/function_with_a_function_parameter_that_returns_two_results.go index b78e053..c3c8d72 100644 --- a/testdata/goldens/function_with_a_function_parameter_that_returns_two_results.go +++ b/testdata/goldens/function_with_a_function_parameter_that_returns_two_results.go @@ -3,18 +3,15 @@ package testdata import "testing" func TestFoo15(t *testing.T) { - type args struct { - f func(string) (string, error) - } tests := []struct { name string - args args + arg func(string) (string, error) wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - if err := Foo15(tt.args.f); (err != nil) != tt.wantErr { + if err := Foo15(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Foo15() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/function_with_a_function_parameter_with_its_own_parameters_and_result.go b/testdata/goldens/function_with_a_function_parameter_with_its_own_parameters_and_result.go index 0254101..d2c9528 100644 --- a/testdata/goldens/function_with_a_function_parameter_with_its_own_parameters_and_result.go +++ b/testdata/goldens/function_with_a_function_parameter_with_its_own_parameters_and_result.go @@ -3,18 +3,15 @@ package testdata import "testing" func TestFoo14(t *testing.T) { - type args struct { - f func(string, int) string - } tests := []struct { name string - args args + arg func(string, int) string wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - if err := Foo14(tt.args.f); (err != nil) != tt.wantErr { + if err := Foo14(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Foo14() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/function_with_a_variadic_parameter.go b/testdata/goldens/function_with_a_variadic_parameter.go index 7091214..b571cb9 100644 --- a/testdata/goldens/function_with_a_variadic_parameter.go +++ b/testdata/goldens/function_with_a_variadic_parameter.go @@ -3,18 +3,15 @@ package testdata import "testing" func TestFoo20(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want string }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - if got := Foo20(tt.args.strs...); got != tt.want { + if got := Foo20(tt.arg...); got != tt.want { t.Errorf("%q. Foo20() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_channel_parameter_and_result.go b/testdata/goldens/function_with_channel_parameter_and_result.go index 7b92e06..b14199e 100644 --- a/testdata/goldens/function_with_channel_parameter_and_result.go +++ b/testdata/goldens/function_with_channel_parameter_and_result.go @@ -6,18 +6,15 @@ import ( ) func TestFoo23(t *testing.T) { - type args struct { - ch chan bool - } tests := []struct { name string - args args + arg chan bool want chan string }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo23(tt.args.ch); !reflect.DeepEqual(got, tt.want) { + if got := Foo23(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo23() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_defined_interface_type_parameter_and_result.go b/testdata/goldens/function_with_defined_interface_type_parameter_and_result.go index e7a0119..e181a64 100644 --- a/testdata/goldens/function_with_defined_interface_type_parameter_and_result.go +++ b/testdata/goldens/function_with_defined_interface_type_parameter_and_result.go @@ -6,18 +6,15 @@ import ( ) func TestFoo16(t *testing.T) { - type args struct { - in Bazzar - } tests := []struct { name string - args args + arg Bazzar want Bazzar }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo16(tt.args.in); !reflect.DeepEqual(got, tt.want) { + if got := Foo16(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo16() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_imported_interface_receiver_parameter_and_result.go b/testdata/goldens/function_with_imported_interface_receiver_parameter_and_result.go index a90c8a2..cec6596 100644 --- a/testdata/goldens/function_with_imported_interface_receiver_parameter_and_result.go +++ b/testdata/goldens/function_with_imported_interface_receiver_parameter_and_result.go @@ -7,18 +7,15 @@ import ( ) func TestFoo17(t *testing.T) { - type args struct { - r io.Reader - } tests := []struct { name string - args args + arg io.Reader want io.Reader }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo17(tt.args.r); !reflect.DeepEqual(got, tt.want) { + if got := Foo17(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo17() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_imported_struct_receiver_parameter_and_result.go b/testdata/goldens/function_with_imported_struct_receiver_parameter_and_result.go index 7b55770..06fc86b 100644 --- a/testdata/goldens/function_with_imported_struct_receiver_parameter_and_result.go +++ b/testdata/goldens/function_with_imported_struct_receiver_parameter_and_result.go @@ -7,18 +7,15 @@ import ( ) func TestFoo18(t *testing.T) { - type args struct { - t *os.File - } tests := []struct { name string - args args + arg *os.File want *os.File }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo18(tt.args.t); !reflect.DeepEqual(got, tt.want) { + if got := Foo18(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo18() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_interface_parameter_and_result.go b/testdata/goldens/function_with_interface_parameter_and_result.go index f3c0700..cadf331 100644 --- a/testdata/goldens/function_with_interface_parameter_and_result.go +++ b/testdata/goldens/function_with_interface_parameter_and_result.go @@ -6,18 +6,15 @@ import ( ) func TestFoo21(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string - args args + arg interface{} want interface{} }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo21(tt.args.i); !reflect.DeepEqual(got, tt.want) { + if got := Foo21(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo21() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_map_argument_and_return_type.go b/testdata/goldens/function_with_map_argument_and_return_type.go index 0bd44df..ab2f1f6 100644 --- a/testdata/goldens/function_with_map_argument_and_return_type.go +++ b/testdata/goldens/function_with_map_argument_and_return_type.go @@ -6,18 +6,15 @@ import ( ) func TestFoo10(t *testing.T) { - type args struct { - m map[string]int32 - } tests := []struct { name string - args args + arg map[string]int32 want map[string]*Bar }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo10(tt.args.m); !reflect.DeepEqual(got, tt.want) { + if got := Foo10(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo10() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_multiple_parameters_of_the_same_type.go b/testdata/goldens/function_with_multiple_parameters_of_the_same_type.go index fb0cd4b..67b06a9 100644 --- a/testdata/goldens/function_with_multiple_parameters_of_the_same_type.go +++ b/testdata/goldens/function_with_multiple_parameters_of_the_same_type.go @@ -13,7 +13,7 @@ func TestFoo19(t *testing.T) { args args want string }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { if got := Foo19(tt.args.in1, tt.args.in2, tt.args.in3); got != tt.want { diff --git a/testdata/goldens/function_with_named_argument.go b/testdata/goldens/function_with_named_argument.go index f7f0686..2244a2d 100644 --- a/testdata/goldens/function_with_named_argument.go +++ b/testdata/goldens/function_with_named_argument.go @@ -3,16 +3,13 @@ package testdata import "testing" func TestFoo3(t *testing.T) { - type args struct { - s string - } tests := []struct { name string - args args + arg string }{ // TODO: Add test cases. } for _, tt := range tests { - Foo3(tt.args.s) + Foo3(tt.arg) } } diff --git a/testdata/goldens/function_with_named_imports.go b/testdata/goldens/function_with_named_imports.go index a9d15c1..4f86fd8 100644 --- a/testdata/goldens/function_with_named_imports.go +++ b/testdata/goldens/function_with_named_imports.go @@ -7,18 +7,15 @@ import ( ) func TestFoo22(t *testing.T) { - type args struct { - t *ht.Template - } tests := []struct { name string - args args + arg *ht.Template want *ht.Template }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Foo22(tt.args.t); !reflect.DeepEqual(got, tt.want) { + if got := Foo22(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Foo22() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/function_with_slice_argument_and_return_type.go b/testdata/goldens/function_with_slice_argument_and_return_type.go index ec947ee..286f4f6 100644 --- a/testdata/goldens/function_with_slice_argument_and_return_type.go +++ b/testdata/goldens/function_with_slice_argument_and_return_type.go @@ -6,19 +6,16 @@ import ( ) func TestFoo11(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - got, err := Foo11(tt.args.strs) + got, err := Foo11(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Foo11() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/function_with_struct_pointer_argument_and_return_type.go b/testdata/goldens/function_with_struct_pointer_argument_and_return_type.go index 5f0d47b..6c0458c 100644 --- a/testdata/goldens/function_with_struct_pointer_argument_and_return_type.go +++ b/testdata/goldens/function_with_struct_pointer_argument_and_return_type.go @@ -6,19 +6,16 @@ import ( ) func TestFoo8(t *testing.T) { - type args struct { - b *Bar - } tests := []struct { name string - args args + arg *Bar want *Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := Foo8(tt.args.b) + got, err := Foo8(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Foo8() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/functions_and_methods_with_name_receivers_parameters_and_results.go b/testdata/goldens/functions_and_methods_with_name_receivers_parameters_and_results.go index 70070b7..c370572 100644 --- a/testdata/goldens/functions_and_methods_with_name_receivers_parameters_and_results.go +++ b/testdata/goldens/functions_and_methods_with_name_receivers_parameters_and_results.go @@ -3,19 +3,16 @@ package testdata import "testing" func Test_name_Name(t *testing.T) { - type args struct { - n string - } tests := []struct { name string n name - args args + arg string want string }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - if got := tt.n.Name(tt.args.n); got != tt.want { + if got := tt.n.Name(tt.arg); got != tt.want { t.Errorf("%q. name.Name() = %v, want %v", tt.name, got, tt.want) } } @@ -25,22 +22,19 @@ func TestName_Name1(t *testing.T) { type fields struct { Name string } - type args struct { - n string - } tests := []struct { name string fields fields - args args + arg string want string }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { n := &Name{ Name: tt.fields.Name, } - if got := n.Name1(tt.args.n); got != tt.want { + if got := n.Name1(tt.arg); got != tt.want { t.Errorf("%q. Name.Name1() = %v, want %v", tt.name, got, tt.want) } } @@ -50,22 +44,19 @@ func TestName_Name2(t *testing.T) { type fields struct { Name string } - type args struct { - name string - } tests := []struct { name string fields fields - args args + arg string want string }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { n := &Name{ Name: tt.fields.Name, } - if got := n.Name2(tt.args.name); got != tt.want { + if got := n.Name2(tt.arg); got != tt.want { t.Errorf("%q. Name.Name2() = %v, want %v", tt.name, got, tt.want) } } @@ -75,22 +66,19 @@ func TestName_Name3(t *testing.T) { type fields struct { Name string } - type args struct { - nn string - } tests := []struct { name string fields fields - args args + arg string wantName string }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { n := &Name{ Name: tt.fields.Name, } - if gotName := n.Name3(tt.args.nn); gotName != tt.wantName { + if gotName := n.Name3(tt.arg); gotName != tt.wantName { t.Errorf("%q. Name.Name3() = %v, want %v", tt.name, gotName, tt.wantName) } } diff --git a/testdata/goldens/io_writer_parameters.go b/testdata/goldens/io_writer_parameters.go index fb5935c..607f989 100644 --- a/testdata/goldens/io_writer_parameters.go +++ b/testdata/goldens/io_writer_parameters.go @@ -12,7 +12,7 @@ func TestBar_Write(t *testing.T) { wantW string wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} @@ -28,20 +28,17 @@ func TestBar_Write(t *testing.T) { } func TestWrite(t *testing.T) { - type args struct { - data string - } tests := []struct { name string - args args + arg string wantW string wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { w := &bytes.Buffer{} - if err := Write(w, tt.args.data); (err != nil) != tt.wantErr { + if err := Write(w, tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Write() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue } @@ -52,24 +49,21 @@ func TestWrite(t *testing.T) { } func TestMultiWrite(t *testing.T) { - type args struct { - data string - } tests := []struct { name string - args args + arg string want int want1 string wantW1 string wantW2 string wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { w1 := &bytes.Buffer{} w2 := &bytes.Buffer{} - got, got1, err := MultiWrite(w1, w2, tt.args.data) + got, got1, err := MultiWrite(w1, w2, tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. MultiWrite() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/method_on_a_struct_pointer.go b/testdata/goldens/method_on_a_struct_pointer.go index e808fc8..a1d6818 100644 --- a/testdata/goldens/method_on_a_struct_pointer.go +++ b/testdata/goldens/method_on_a_struct_pointer.go @@ -3,21 +3,18 @@ package testdata import "testing" func TestBar_Foo7(t *testing.T) { - type args struct { - i int - } tests := []struct { name string b *Bar - args args + arg int want string wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - got, err := b.Foo7(tt.args.i) + got, err := b.Foo7(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Bar.Foo7() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/multiple_functions.go b/testdata/goldens/multiple_functions.go index 71296f3..8352892 100644 --- a/testdata/goldens/multiple_functions.go +++ b/testdata/goldens/multiple_functions.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,38 +27,32 @@ func TestFooFilter(t *testing.T) { } func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } } func Test_bazFilter(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ // TODO: Add test cases. } for _, tt := range tests { - if got := bazFilter(tt.args.f); got != tt.want { + if got := bazFilter(tt.arg); got != tt.want { t.Errorf("%q. bazFilter() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/multiple_functions_excluding_on_method.go b/testdata/goldens/multiple_functions_excluding_on_method.go index 139e895..82ec3ed 100644 --- a/testdata/goldens/multiple_functions_excluding_on_method.go +++ b/testdata/goldens/multiple_functions_excluding_on_method.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,18 +27,15 @@ func TestFooFilter(t *testing.T) { } func Test_bazFilter(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ // TODO: Add test cases. } for _, tt := range tests { - if got := bazFilter(tt.args.f); got != tt.want { + if got := bazFilter(tt.arg); got != tt.want { t.Errorf("%q. bazFilter() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/multiple_functions_excluding_on_receiver.go b/testdata/goldens/multiple_functions_excluding_on_receiver.go index 139e895..82ec3ed 100644 --- a/testdata/goldens/multiple_functions_excluding_on_receiver.go +++ b/testdata/goldens/multiple_functions_excluding_on_receiver.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,18 +27,15 @@ func TestFooFilter(t *testing.T) { } func Test_bazFilter(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ // TODO: Add test cases. } for _, tt := range tests { - if got := bazFilter(tt.args.f); got != tt.want { + if got := bazFilter(tt.arg); got != tt.want { t.Errorf("%q. bazFilter() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/multiple_functions_filtering_exported.go b/testdata/goldens/multiple_functions_filtering_exported.go index d0d2654..0429b93 100644 --- a/testdata/goldens/multiple_functions_filtering_exported.go +++ b/testdata/goldens/multiple_functions_filtering_exported.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,20 +27,17 @@ func TestFooFilter(t *testing.T) { } func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_filtering_exported_with_excl.go b/testdata/goldens/multiple_functions_filtering_exported_with_excl.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_filtering_exported_with_excl.go +++ b/testdata/goldens/multiple_functions_filtering_exported_with_excl.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_filtering_exported_with_only.go b/testdata/goldens/multiple_functions_filtering_exported_with_only.go index 588df3f..171b01c 100644 --- a/testdata/goldens/multiple_functions_filtering_exported_with_only.go +++ b/testdata/goldens/multiple_functions_filtering_exported_with_only.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/multiple_functions_with_both_only_and_excl.go b/testdata/goldens/multiple_functions_with_both_only_and_excl.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_with_both_only_and_excl.go +++ b/testdata/goldens/multiple_functions_with_both_only_and_excl.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_with_case-insensitive_excl.go b/testdata/goldens/multiple_functions_with_case-insensitive_excl.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_with_case-insensitive_excl.go +++ b/testdata/goldens/multiple_functions_with_case-insensitive_excl.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_with_case-insensitive_only.go b/testdata/goldens/multiple_functions_with_case-insensitive_only.go index 139e895..82ec3ed 100644 --- a/testdata/goldens/multiple_functions_with_case-insensitive_only.go +++ b/testdata/goldens/multiple_functions_with_case-insensitive_only.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,18 +27,15 @@ func TestFooFilter(t *testing.T) { } func Test_bazFilter(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ // TODO: Add test cases. } for _, tt := range tests { - if got := bazFilter(tt.args.f); got != tt.want { + if got := bazFilter(tt.arg); got != tt.want { t.Errorf("%q. bazFilter() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/multiple_functions_with_excl.go b/testdata/goldens/multiple_functions_with_excl.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_with_excl.go +++ b/testdata/goldens/multiple_functions_with_excl.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_with_only.go b/testdata/goldens/multiple_functions_with_only.go index 139e895..8418b2c 100644 --- a/testdata/goldens/multiple_functions_with_only.go +++ b/testdata/goldens/multiple_functions_with_only.go @@ -6,19 +6,16 @@ import ( ) func TestFooFilter(t *testing.T) { - type args struct { - strs []string - } tests := []struct { name string - args args + arg []string want []*Bar wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - got, err := FooFilter(tt.args.strs) + got, err := FooFilter(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. FooFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue @@ -30,18 +27,15 @@ func TestFooFilter(t *testing.T) { } func Test_bazFilter(t *testing.T) { - type args struct { - f *float64 - } tests := []struct { name string - args args + arg *float64 want float64 }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { - if got := bazFilter(tt.args.f); got != tt.want { + if got := bazFilter(tt.arg); got != tt.want { t.Errorf("%q. bazFilter() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/multiple_functions_with_only_and_excl_competing.go b/testdata/goldens/multiple_functions_with_only_and_excl_competing.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_with_only_and_excl_competing.go +++ b/testdata/goldens/multiple_functions_with_only_and_excl_competing.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_with_only_filtering_on_method.go b/testdata/goldens/multiple_functions_with_only_filtering_on_method.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_with_only_filtering_on_method.go +++ b/testdata/goldens/multiple_functions_with_only_filtering_on_method.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_functions_with_only_filtering_on_receiver.go b/testdata/goldens/multiple_functions_with_only_filtering_on_receiver.go index 4152955..c26d16f 100644 --- a/testdata/goldens/multiple_functions_with_only_filtering_on_receiver.go +++ b/testdata/goldens/multiple_functions_with_only_filtering_on_receiver.go @@ -3,20 +3,17 @@ package testdata import "testing" func TestBar_BarFilter(t *testing.T) { - type args struct { - i interface{} - } tests := []struct { name string b *Bar - args args + arg interface{} wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - if err := b.BarFilter(tt.args.i); (err != nil) != tt.wantErr { + if err := b.BarFilter(tt.arg); (err != nil) != tt.wantErr { t.Errorf("%q. Bar.BarFilter() error = %v, wantErr %v", tt.name, err, tt.wantErr) } } diff --git a/testdata/goldens/multiple_named_results.go b/testdata/goldens/multiple_named_results.go index 871aeea..872cf51 100644 --- a/testdata/goldens/multiple_named_results.go +++ b/testdata/goldens/multiple_named_results.go @@ -6,12 +6,9 @@ import ( ) func TestFoo26(t *testing.T) { - type args struct { - v interface{} - } tests := []struct { name string - args args + arg interface{} want string wantI int want2 []byte @@ -20,7 +17,7 @@ func TestFoo26(t *testing.T) { // TODO: Add test cases. } for _, tt := range tests { - got, gotI, got2, err := Foo26(tt.args.v) + got, gotI, got2, err := Foo26(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Foo26() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/print_inputs_with_single_argument.go b/testdata/goldens/print_inputs_with_single_argument.go index 30722c1..db1ecdd 100644 --- a/testdata/goldens/print_inputs_with_single_argument.go +++ b/testdata/goldens/print_inputs_with_single_argument.go @@ -3,27 +3,24 @@ package testdata import "testing" func TestBar_Foo7(t *testing.T) { - type args struct { - i int - } tests := []struct { name string b *Bar - args args + arg int want string wantErr bool }{ - // TODO: Add test cases. + // TODO: Add test cases. } for _, tt := range tests { b := &Bar{} - got, err := b.Foo7(tt.args.i) + got, err := b.Foo7(tt.arg) if (err != nil) != tt.wantErr { - t.Errorf("%q. Bar.Foo7(%v) error = %v, wantErr %v", tt.name, tt.args.i, err, tt.wantErr) + t.Errorf("%q. Bar.Foo7(%v) error = %v, wantErr %v", tt.name, tt.arg, err, tt.wantErr) continue } if got != tt.want { - t.Errorf("%q. Bar.Foo7(%v) = %v, want %v", tt.name, tt.args.i, got, tt.want) + t.Errorf("%q. Bar.Foo7(%v) = %v, want %v", tt.name, tt.arg, got, tt.want) } } } diff --git a/testdata/goldens/receiver_struct_with_fields_with_complex_package_names.go b/testdata/goldens/receiver_struct_with_fields_with_complex_package_names.go index 2c54ac7..ca9459f 100644 --- a/testdata/goldens/receiver_struct_with_fields_with_complex_package_names.go +++ b/testdata/goldens/receiver_struct_with_fields_with_complex_package_names.go @@ -11,13 +11,10 @@ func TestImporter_Foo35(t *testing.T) { Importer types.Importer Field *types.Var } - type args struct { - t types.Type - } tests := []struct { name string fields fields - args args + arg types.Type want *types.Var }{ // TODO: Add test cases. @@ -27,7 +24,7 @@ func TestImporter_Foo35(t *testing.T) { Importer: tt.fields.Importer, Field: tt.fields.Field, } - if got := i.Foo35(tt.args.t); !reflect.DeepEqual(got, tt.want) { + if got := i.Foo35(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("%q. Importer.Foo35() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/struct_receiver_with_anonymous_fields.go b/testdata/goldens/struct_receiver_with_anonymous_fields.go index 0539e74..a7769f5 100644 --- a/testdata/goldens/struct_receiver_with_anonymous_fields.go +++ b/testdata/goldens/struct_receiver_with_anonymous_fields.go @@ -9,13 +9,10 @@ func TestDoctor_SayHello(t *testing.T) { numPatients int string string } - type args struct { - r *Person - } tests := []struct { name string fields fields - args args + arg *Person want string }{ // TODO: Add test cases. @@ -27,7 +24,7 @@ func TestDoctor_SayHello(t *testing.T) { numPatients: tt.fields.numPatients, string: tt.fields.string, } - if got := d.SayHello(tt.args.r); got != tt.want { + if got := d.SayHello(tt.arg); got != tt.want { t.Errorf("%q. Doctor.SayHello() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/struct_receiver_with_multiple_fields.go b/testdata/goldens/struct_receiver_with_multiple_fields.go index 0d8212c..2d4ff50 100644 --- a/testdata/goldens/struct_receiver_with_multiple_fields.go +++ b/testdata/goldens/struct_receiver_with_multiple_fields.go @@ -10,13 +10,10 @@ func TestPerson_SayHello(t *testing.T) { Gender string Siblings []*Person } - type args struct { - r *Person - } tests := []struct { name string fields fields - args args + arg *Person want string }{ // TODO: Add test cases. @@ -29,7 +26,7 @@ func TestPerson_SayHello(t *testing.T) { Gender: tt.fields.Gender, Siblings: tt.fields.Siblings, } - if got := p.SayHello(tt.args.r); got != tt.want { + if got := p.SayHello(tt.arg); got != tt.want { t.Errorf("%q. Person.SayHello() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/target_test_file.go b/testdata/goldens/target_test_file.go index 5aacfdb..5185602 100644 --- a/testdata/goldens/target_test_file.go +++ b/testdata/goldens/target_test_file.go @@ -55,19 +55,16 @@ func wrapToString(in []int) []string { } func Test_wrapToString(t *testing.T) { - type args struct { - in []int - } tests := []struct { name string - args args + arg []int want []string }{ // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := wrapToString(tt.args.in); !reflect.DeepEqual(got, tt.want) { + if got := wrapToString(tt.arg); !reflect.DeepEqual(got, tt.want) { t.Errorf("wrapToString() = %v, want %v", got, tt.want) } }) diff --git a/testdata/goldens/test_file_with_syntax_errors.go b/testdata/goldens/test_file_with_syntax_errors.go index 764c32c..070c761 100644 --- a/testdata/goldens/test_file_with_syntax_errors.go +++ b/testdata/goldens/test_file_with_syntax_errors.go @@ -12,18 +12,15 @@ func Foo(s strings) errors { } func TestNot(t *testing.T) { - type args struct { - this *os.File - } tests := []struct { name string - args args + arg *os.File want string }{ // TODO: Add test cases. } for _, tt := range tests { - if got := Not(tt.args.this); got != tt.want { + if got := Not(tt.arg); got != tt.want { t.Errorf("%q. Not() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/goldens/undefined_types.go b/testdata/goldens/undefined_types.go index e792b1c..da1837a 100644 --- a/testdata/goldens/undefined_types.go +++ b/testdata/goldens/undefined_types.go @@ -6,20 +6,17 @@ import ( ) func TestUndefined_Do(t *testing.T) { - type args struct { - es Something - } tests := []struct { name string u *Undefined - args args + arg Something want *Unknown wantErr bool }{ // TODO: Add test cases. } for _, tt := range tests { - got, err := tt.u.Do(tt.args.es) + got, err := tt.u.Do(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("%q. Undefined.Do() error = %v, wantErr %v", tt.name, err, tt.wantErr) continue diff --git a/testdata/goldens/underlying_types.go b/testdata/goldens/underlying_types.go index ad4c36a..093bb70 100644 --- a/testdata/goldens/underlying_types.go +++ b/testdata/goldens/underlying_types.go @@ -21,18 +21,15 @@ func TestCelsius_ToFahrenheit(t *testing.T) { } func TestHourToSecond(t *testing.T) { - type args struct { - h time.Duration - } tests := []struct { name string - args args + arg time.Duration want time.Duration }{ // TODO: Add test cases. } for _, tt := range tests { - if got := HourToSecond(tt.args.h); got != tt.want { + if got := HourToSecond(tt.arg); got != tt.want { t.Errorf("%q. HourToSecond() = %v, want %v", tt.name, got, tt.want) } } diff --git a/testdata/test_existing_test_file_with_comments.go b/testdata/test_existing_test_file_with_comments.go index 11660d2..870b521 100644 --- a/testdata/test_existing_test_file_with_comments.go +++ b/testdata/test_existing_test_file_with_comments.go @@ -8,6 +8,7 @@ // cupidatat non proident, sunt in culpa qui officia // deserunt mollit anim id est laborum. + package testdata func BeforeComment() string {