MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestToStringSlice

Function TestToStringSlice

pkg/scopes/scopes_test.go:110–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func 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
141func TestScopeHierarchy(t *testing.T) {
142 // Verify the hierarchy is correctly defined

Callers

nothing calls this directly

Calls 1

ToStringSliceFunction · 0.85

Tested by

no test coverage detected