-
Notifications
You must be signed in to change notification settings - Fork 149
/
popular_actions_test.go
37 lines (34 loc) · 823 Bytes
/
popular_actions_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
package actionlint
import (
"strings"
"testing"
)
func TestPopularActionsDataset(t *testing.T) {
if len(PopularActions) == 0 {
t.Fatal("popular actions data set is empty")
}
for n, meta := range PopularActions {
if meta == nil {
t.Fatalf("metadata for %s is nil", n)
}
if meta.Name == "" {
t.Fatalf("action name for %s is empty", n)
}
for id, i := range meta.Inputs {
if id != strings.ToLower(id) {
t.Errorf("input ID %q is not in lower case at %q", id, n)
}
if i.Name == "" {
t.Errorf("input name is not empty at ID %q at %q", id, n)
}
}
for id, o := range meta.Outputs {
if id != strings.ToLower(id) {
t.Errorf("output ID %q is not in lower case at %q", id, n)
}
if o.Name == "" {
t.Errorf("output name is not empty at ID %q at %q", id, n)
}
}
}
}