forked from trek10inc/awsets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
40 lines (37 loc) · 891 Bytes
/
main_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
package awsets
import (
"strings"
"testing"
)
func Test_Types(t *testing.T) {
types := Types([]string{""}, []string{""})
if len(types) == 0 {
t.Fatalf("expected all types")
}
types = Types(nil, nil)
if len(types) == 0 {
t.Fatalf("expected all types")
}
types = Types([]string{""}, []string{"ec2"})
for _, rt := range types {
if strings.HasPrefix(rt.String(), "ec2") {
t.Fatalf("expected ec2* resource types to have been filtered out")
}
}
types = Types([]string{"ec2"}, []string{""})
for _, rt := range types {
if !strings.HasPrefix(rt.String(), "ec2") {
t.Fatalf("on expected ec2* resource types to be present")
}
}
}
func Test_Listers(t *testing.T) {
listers := Listers([]string{""}, []string{""})
if len(listers) == 0 {
t.Fatalf("expected all listers")
}
listers = Listers(nil, nil)
if len(listers) == 0 {
t.Fatalf("expected all listers")
}
}