package parser import ( "testing" "github.com/google/go-cmp/cmp" ) func TestExternalPackages(t *testing.T) { tests := []struct { name string dir string wantBoundMethods map[string]map[string][]*BoundMethod wantErr bool }{} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, err := ParseProject(tt.dir) if (err != nil) != tt.wantErr { t.Errorf("ParseDirectory() error = %v, wantErr %v", err, tt.wantErr) return } if diff := cmp.Diff(tt.wantBoundMethods, got.BoundMethods); diff != "" { t.Errorf("ParseDirectory() failed:\n" + diff) } }) } }