MCPcopy Index your code
hub / github.com/cli/cli / Test_QueryHasStateClause

Function Test_QueryHasStateClause

pkg/cmd/pr/shared/params_test.go:394–432  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

392}
393
394func 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
434func Test_WithPrAndIssueQueryParams(t *testing.T) {
435 type args struct {

Callers

nothing calls this directly

Calls 2

QueryHasStateClauseFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected