@@ -17,6 +17,7 @@ type scopeTestNormalize struct {
1717}
1818
1919func TestAccessTokenScope_Normalize (t * testing.T ) {
20+ assert .Equal (t , []string {"activitypub" , "admin" , "issue" , "misc" , "notification" , "organization" , "package" , "repository" , "user" }, GetAccessTokenCategories ())
2021 tests := []scopeTestNormalize {
2122 {"" , "" , nil },
2223 {"write:misc,write:notification,read:package,write:notification,public-only" , "public-only,write:misc,write:notification,read:package" , nil },
@@ -25,7 +26,7 @@ func TestAccessTokenScope_Normalize(t *testing.T) {
2526 {"write:activitypub,write:admin,write:misc,write:notification,write:organization,write:package,write:issue,write:repository,write:user,public-only" , "public-only,all" , nil },
2627 }
2728
28- for _ , scope := range [] string { "activitypub" , "admin" , "misc" , "notification" , "organization" , "package" , "issue" , "repository" , "user" } {
29+ for _ , scope := range GetAccessTokenCategories () {
2930 tests = append (tests ,
3031 scopeTestNormalize {AccessTokenScope (fmt .Sprintf ("read:%s" , scope )), AccessTokenScope (fmt .Sprintf ("read:%s" , scope )), nil },
3132 scopeTestNormalize {AccessTokenScope (fmt .Sprintf ("write:%s" , scope )), AccessTokenScope (fmt .Sprintf ("write:%s" , scope )), nil },
@@ -59,7 +60,7 @@ func TestAccessTokenScope_HasScope(t *testing.T) {
5960 {"public-only" , "read:issue" , false , nil },
6061 }
6162
62- for _ , scope := range [] string { "activitypub" , "admin" , "misc" , "notification" , "organization" , "package" , "issue" , "repository" , "user" } {
63+ for _ , scope := range GetAccessTokenCategories () {
6364 tests = append (tests ,
6465 scopeTestHasScope {
6566 AccessTokenScope (fmt .Sprintf ("read:%s" , scope )),
0 commit comments