File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
20
20
"fmt"
21
21
"io/ioutil"
22
22
"os"
23
+ "sort"
23
24
"strings"
24
25
"testing"
25
26
@@ -77,6 +78,15 @@ func testDuplicates(list []string) error {
77
78
return nil
78
79
}
79
80
81
+ func isSorted (list []string ) bool {
82
+ items := make ([]string , len (list ))
83
+ for _ , l := range list {
84
+ items = append (items , strings .ToLower (l ))
85
+ }
86
+
87
+ return sort .StringsAreSorted (items )
88
+ }
89
+
80
90
func testOrg (targetDir string , t * testing.T ) {
81
91
cfg , err := loadOrg (targetDir )
82
92
if err != nil {
@@ -125,6 +135,12 @@ func testOrg(targetDir string, t *testing.T) {
125
135
if err := testDuplicates (own .Approvers ); err != nil {
126
136
t .Errorf ("duplicate approvers: %v" , err )
127
137
}
138
+ if ! isSorted (cfg .Admins ) {
139
+ t .Errorf ("admins are unsorted" )
140
+ }
141
+ if ! isSorted (cfg .Members ) {
142
+ t .Errorf ("members are unsorted" )
143
+ }
128
144
}
129
145
130
146
func TestAllOrgs (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments