(t *testing.T)
| 392 | } |
| 393 | |
| 394 | func Test_QueryHasStateClause(t *testing.T) { |
| 395 | tests := []struct { |
| 396 | searchQuery string |
| 397 | hasState bool |
| 398 | }{ |
| 399 | { |
| 400 | searchQuery: "is:closed is:merged", |
| 401 | hasState: true, |
| 402 | }, |
| 403 | { |
| 404 | searchQuery: "author:mislav", |
| 405 | hasState: false, |
| 406 | }, |
| 407 | { |
| 408 | searchQuery: "assignee:g14a mentions:vilmibm", |
| 409 | hasState: false, |
| 410 | }, |
| 411 | { |
| 412 | searchQuery: "merged:>2021-05-20", |
| 413 | hasState: true, |
| 414 | }, |
| 415 | { |
| 416 | searchQuery: "state:merged state:open", |
| 417 | hasState: true, |
| 418 | }, |
| 419 | { |
| 420 | searchQuery: "assignee:g14a is:closed", |
| 421 | hasState: true, |
| 422 | }, |
| 423 | { |
| 424 | searchQuery: "state:closed label:bug", |
| 425 | hasState: true, |
| 426 | }, |
| 427 | } |
| 428 | for _, tt := range tests { |
| 429 | gotState := QueryHasStateClause(tt.searchQuery) |
| 430 | assert.Equal(t, tt.hasState, gotState) |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | func Test_WithPrAndIssueQueryParams(t *testing.T) { |
| 435 | type args struct { |
nothing calls this directly
no test coverage detected