@@ -169,8 +169,8 @@ func TestConverterConvFile(t *testing.T) {
169169 t .Run (tc .name , func (t * testing.T ) {
170170 goFile , ok := converter .convFile (tc .file , nil )
171171
172- if goFile != tc .expected {
173- t .Errorf ("Expected file %s, got %s" , tc .expected , goFile )
172+ if goFile . FileName != tc .expected {
173+ t .Errorf ("Expected file %s, got %s" , tc .expected , goFile . FileName )
174174 }
175175
176176 if ok != tc .ok {
@@ -226,7 +226,7 @@ func TestConv(t *testing.T) {
226226 trimPrefixes []string
227227 expectFile string
228228 expectName string
229- exec func (conv * Converter , convNode ast.Node ) (string , string , error )
229+ exec func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error )
230230 expectErr error
231231 }{
232232 {
@@ -235,7 +235,7 @@ func TestConv(t *testing.T) {
235235 Name : "MACRO_NAME" ,
236236 Loc : & ast.Location {File : interFile },
237237 },
238- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
238+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
239239 return conv .ConvMacro (interFile , convNode .(* ast.Macro ))
240240 },
241241 expectFile : "inter.go" ,
@@ -248,7 +248,7 @@ func TestConv(t *testing.T) {
248248 Name : "MACRO_NAME" ,
249249 Loc : & ast.Location {File : interFile },
250250 },
251- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
251+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
252252 return conv .ConvMacro (interFile , convNode .(* ast.Macro ))
253253 },
254254 trimPrefixes : []string {"MACRO_" },
@@ -263,7 +263,7 @@ func TestConv(t *testing.T) {
263263 Loc : & ast.Location {File : interFile },
264264 },
265265 pubs : map [string ]string {"MACRO_CONST" : "CustomMacro" },
266- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
266+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
267267 return conv .ConvMacro (interFile , convNode .(* ast.Macro ))
268268 },
269269 expectFile : "inter.go" ,
@@ -276,7 +276,7 @@ func TestConv(t *testing.T) {
276276 Name : "MACRO_NAME" ,
277277 Loc : & ast.Location {File : thirdFile },
278278 },
279- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
279+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
280280 return conv .ConvMacro (thirdFile , convNode .(* ast.Macro ))
281281 },
282282 expectFile : "testpkg_autogen.go" ,
@@ -292,7 +292,7 @@ func TestConv(t *testing.T) {
292292 MangledName : "validFunc" ,
293293 },
294294 convSym : mockSymConv ,
295- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
295+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
296296 return conv .ConvDecl (interFile , convNode .(* ast.FuncDecl ))
297297 },
298298 expectFile : "inter.go" ,
@@ -307,7 +307,7 @@ func TestConv(t *testing.T) {
307307 Loc : & ast.Location {File : thirdFile },
308308 },
309309 },
310- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
310+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
311311 return conv .ConvDecl (thirdFile , convNode .(* ast.FuncDecl ))
312312 },
313313 expectFile : "testpkg_autogen.go" ,
@@ -322,7 +322,7 @@ func TestConv(t *testing.T) {
322322 },
323323 MangledName : "noSymbolFunc" ,
324324 },
325- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
325+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
326326 return conv .ConvDecl (interFile , convNode .(* ast.FuncDecl ))
327327 },
328328 convSym : mockSymConv ,
@@ -337,7 +337,7 @@ func TestConv(t *testing.T) {
337337 Loc : & ast.Location {File : interFile },
338338 },
339339 },
340- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
340+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
341341 return conv .ConvDecl (interFile , convNode .(* ast.EnumTypeDecl ))
342342 },
343343 expectFile : "inter.go" ,
@@ -352,7 +352,7 @@ func TestConv(t *testing.T) {
352352 Loc : & ast.Location {File : interFile },
353353 },
354354 },
355- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
355+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
356356 return conv .ConvDecl (interFile , convNode .(* ast.EnumTypeDecl ))
357357 },
358358 expectFile : "inter.go" ,
@@ -366,7 +366,7 @@ func TestConv(t *testing.T) {
366366 Loc : & ast.Location {File : interFile },
367367 },
368368 },
369- exec : func (conv * Converter , convNode ast.Node ) (string , string , error ) {
369+ exec : func (conv * Converter , convNode ast.Node ) (string , * nc. GoFile , error ) {
370370 return conv .ConvDecl (interFile , convNode .(* ast.TypeDecl ))
371371 },
372372 expectFile : "inter.go" ,
@@ -388,8 +388,8 @@ func TestConv(t *testing.T) {
388388 if goName != tc .expectName {
389389 t .Errorf ("Expected %s, got %s" , tc .expectName , goName )
390390 }
391- if goFile != tc .expectFile {
392- t .Errorf ("Expected %s, got %s" , tc .expectFile , goFile )
391+ if goFile . FileName != tc .expectFile {
392+ t .Errorf ("Expected %s, got %s" , tc .expectFile , goFile . FileName )
393393 }
394394 if err != tc .expectErr {
395395 t .Errorf ("Expected %v, got %v" , tc .expectErr , err )
0 commit comments