-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuildspec_test.go
50 lines (48 loc) · 971 Bytes
/
buildspec_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"reflect"
"testing"
)
func Test_filterAndroidArtifactsBy(t *testing.T) {
tests := []struct {
name string
androidOutputType OutputType
artifacts []string
want []string
}{
{
name: "Filter APK",
androidOutputType: OutputTypeAPK,
artifacts: []string{
"test.apk",
"test_2.apk",
"test.aab",
},
want: []string{
"test.apk",
"test_2.apk",
},
},
{
name: "Filter AAB",
androidOutputType: OutputTypeAppBundle,
artifacts: []string{
"test.apk",
"test_2.apk",
"test.aab",
"test_2.aab",
},
want: []string{
"test.aab",
"test_2.aab",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := filterAndroidArtifactsBy(tt.androidOutputType, tt.artifacts); !reflect.DeepEqual(got, tt.want) {
t.Errorf("filterAndroidArtifactsBy() = %v, want %v", got, tt.want)
}
})
}
}