forked from sl1pm4t/k2tf
-
Notifications
You must be signed in to change notification settings - Fork 2
/
input_test.go
47 lines (45 loc) · 801 Bytes
/
input_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
package main
import (
"testing"
)
func Test_readFilesInput(t *testing.T) {
tests := []struct {
name string
input string
wantObjCount int
}{
{
"test-fixtures/service.yaml",
"test-fixtures/service.yaml",
1,
},
{
"test-fixtures",
"test-fixtures",
19,
},
{
"test-fixtures/",
"test-fixtures/",
19,
},
{
"test-fixtures/nested/server-clusterrole.yaml",
"test-fixtures/nested/server-clusterrole.yaml",
1,
},
{
"test-fixtures/nested/",
"test-fixtures/nested/",
4,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
input = tt.input
if got := readFilesInput(); len(got) != tt.wantObjCount {
t.Errorf("readFilesInput() object Count = %d, want %d", len(got), tt.wantObjCount)
}
})
}
}