(t *testing.T)
| 108 | } |
| 109 | |
| 110 | func TestToStringSlice(t *testing.T) { |
| 111 | tests := []struct { |
| 112 | name string |
| 113 | scopes []Scope |
| 114 | expected []string |
| 115 | }{ |
| 116 | { |
| 117 | name: "empty returns empty", |
| 118 | scopes: []Scope{}, |
| 119 | expected: []string{}, |
| 120 | }, |
| 121 | { |
| 122 | name: "single scope", |
| 123 | scopes: []Scope{Repo}, |
| 124 | expected: []string{"repo"}, |
| 125 | }, |
| 126 | { |
| 127 | name: "multiple scopes", |
| 128 | scopes: []Scope{Repo, Gist, ReadOrg}, |
| 129 | expected: []string{"repo", "gist", "read:org"}, |
| 130 | }, |
| 131 | } |
| 132 | |
| 133 | for _, tt := range tests { |
| 134 | t.Run(tt.name, func(t *testing.T) { |
| 135 | result := ToStringSlice(tt.scopes...) |
| 136 | assert.Equal(t, tt.expected, result) |
| 137 | }) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | func TestScopeHierarchy(t *testing.T) { |
| 142 | // Verify the hierarchy is correctly defined |
nothing calls this directly
no test coverage detected