| 239 | } |
| 240 | |
| 241 | func TestQualifiersMap(t *testing.T) { |
| 242 | tests := []struct { |
| 243 | name string |
| 244 | qualifiers Qualifiers |
| 245 | out map[string][]string |
| 246 | }{ |
| 247 | { |
| 248 | name: "changes qualifiers to map", |
| 249 | qualifiers: Qualifiers{ |
| 250 | Archived: &trueBool, |
| 251 | AuthorEmail: "foo@example.com", |
| 252 | CommitterDate: "2021-02-28", |
| 253 | Created: "created", |
| 254 | Extension: "go", |
| 255 | Filename: ".vimrc", |
| 256 | Followers: "1", |
| 257 | Fork: "true", |
| 258 | Forks: "2", |
| 259 | GoodFirstIssues: "3", |
| 260 | HelpWantedIssues: "4", |
| 261 | In: []string{"readme"}, |
| 262 | Is: []string{"public"}, |
| 263 | Language: "language", |
| 264 | License: []string{"license"}, |
| 265 | Pushed: "updated", |
| 266 | Size: "5", |
| 267 | Stars: "6", |
| 268 | Topic: []string{"topic"}, |
| 269 | Topics: "7", |
| 270 | User: []string{"user1", "user2"}, |
| 271 | }, |
| 272 | out: map[string][]string{ |
| 273 | "archived": {"true"}, |
| 274 | "author-email": {"foo@example.com"}, |
| 275 | "committer-date": {"2021-02-28"}, |
| 276 | "created": {"created"}, |
| 277 | "extension": {"go"}, |
| 278 | "filename": {".vimrc"}, |
| 279 | "followers": {"1"}, |
| 280 | "fork": {"true"}, |
| 281 | "forks": {"2"}, |
| 282 | "good-first-issues": {"3"}, |
| 283 | "help-wanted-issues": {"4"}, |
| 284 | "in": {"readme"}, |
| 285 | "is": {"public"}, |
| 286 | "language": {"language"}, |
| 287 | "license": {"license"}, |
| 288 | "pushed": {"updated"}, |
| 289 | "size": {"5"}, |
| 290 | "stars": {"6"}, |
| 291 | "topic": {"topic"}, |
| 292 | "topics": {"7"}, |
| 293 | "user": {"user1", "user2"}, |
| 294 | }, |
| 295 | }, |
| 296 | { |
| 297 | name: "excludes unset qualifiers from map", |
| 298 | qualifiers: Qualifiers{ |