mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 07:09:54 +08:00
29 lines
639 B
Go
29 lines
639 B
Go
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)
|
|
}
|
|
})
|
|
}
|
|
}
|