mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 09:19:17 +08:00

* Update staticanalysis.go and associated tests * Update changelog * Changed format of octal literal * Update changelog
52 lines
993 B
Go
52 lines
993 B
Go
package staticanalysis
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetEmbedDetails(t *testing.T) {
|
|
type args struct {
|
|
sourcePath string
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want []*EmbedDetails
|
|
wantErr bool
|
|
}{
|
|
{
|
|
name: "GetEmbedDetails",
|
|
args: args{
|
|
sourcePath: "test/standard",
|
|
},
|
|
want: []*EmbedDetails{
|
|
{
|
|
EmbedPath: "frontend/dist",
|
|
All: true,
|
|
},
|
|
{
|
|
EmbedPath: "frontend/static",
|
|
All: false,
|
|
},
|
|
},
|
|
wantErr: false,
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
got, err := GetEmbedDetails(tt.args.sourcePath)
|
|
if (err != nil) != tt.wantErr {
|
|
t.Errorf("GetEmbedDetails() error = %v, wantErr %v", err, tt.wantErr)
|
|
return
|
|
}
|
|
require.Equal(t, len(tt.want), len(got))
|
|
for index, g := range got {
|
|
require.Equal(t, tt.want[index].EmbedPath, g.EmbedPath)
|
|
require.Equal(t, tt.want[index].All, g.All)
|
|
}
|
|
})
|
|
}
|
|
}
|