MCPcopy
hub / github.com/cli/cli / Test_extEntry

Function Test_extEntry

pkg/cmd/extension/browse/browse_test.go:193–268  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func Test_extEntry(t *testing.T) {
194 cases := []struct {
195 name string
196 ee extEntry
197 expectedTitle string
198 expectedDesc string
199 }{
200 {
201 name: "official",
202 ee: extEntry{
203 Name: "gh-cool",
204 FullName: "cli/gh-cool",
205 Installed: false,
206 Official: true,
207 description: "it's just cool ok",
208 },
209 expectedTitle: "cli/gh-cool [yellow](official)",
210 expectedDesc: "it's just cool ok",
211 },
212 {
213 name: "no description",
214 ee: extEntry{
215 Name: "gh-nodesc",
216 FullName: "barryburton/gh-nodesc",
217 Installed: false,
218 Official: false,
219 description: "",
220 },
221 expectedTitle: "barryburton/gh-nodesc",
222 expectedDesc: "no description provided",
223 },
224 {
225 name: "installed",
226 ee: extEntry{
227 Name: "gh-screensaver",
228 FullName: "vilmibm/gh-screensaver",
229 Installed: true,
230 Official: false,
231 description: "animations in your terminal",
232 },
233 expectedTitle: "vilmibm/gh-screensaver [green](installed)",
234 expectedDesc: "animations in your terminal",
235 },
236 {
237 name: "neither",
238 ee: extEntry{
239 Name: "gh-triage",
240 FullName: "samcoe/gh-triage",
241 Installed: false,
242 Official: false,
243 description: "help with triage",
244 },
245 expectedTitle: "samcoe/gh-triage",
246 expectedDesc: "help with triage",
247 },
248 {
249 name: "both",
250 ee: extEntry{

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.80
DescriptionMethod · 0.80
RunMethod · 0.65
TitleMethod · 0.65

Tested by

no test coverage detected