(t *testing.T)
| 191 | } |
| 192 | |
| 193 | func 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{ |
nothing calls this directly
no test coverage detected