"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/cmd/pr/shared/params_test.go" between
gh-cli-1.11.0.tar.gz and gh-cli-1.12.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

params_test.go  (gh-cli-1.11.0):params_test.go  (gh-cli-1.12.0)
package shared package shared
import ( import (
"github.com/stretchr/testify/assert"
"net/http" "net/http"
"reflect" "reflect"
"testing" "testing"
"github.com/cli/cli/api" "github.com/cli/cli/api"
"github.com/cli/cli/internal/ghrepo" "github.com/cli/cli/internal/ghrepo"
"github.com/cli/cli/pkg/httpmock" "github.com/cli/cli/pkg/httpmock"
"github.com/stretchr/testify/assert"
) )
func Test_listURLWithQuery(t *testing.T) { func Test_listURLWithQuery(t *testing.T) {
type args struct { type args struct {
listURL string listURL string
options FilterOptions options FilterOptions
} }
tests := []struct { tests := []struct {
name string name string
args args args args
skipping to change at line 195 skipping to change at line 195
{ {
searchQuery: "state:closed label:bug", searchQuery: "state:closed label:bug",
hasState: true, hasState: true,
}, },
} }
for _, tt := range tests { for _, tt := range tests {
gotState := QueryHasStateClause(tt.searchQuery) gotState := QueryHasStateClause(tt.searchQuery)
assert.Equal(t, tt.hasState, gotState) assert.Equal(t, tt.hasState, gotState)
} }
} }
func Test_WithPrAndIssueQueryParams(t *testing.T) {
type args struct {
baseURL string
state IssueMetadataState
}
tests := []struct {
name string
args args
want string
wantErr bool
}{
{
name: "blank",
args: args{
baseURL: "",
state: IssueMetadataState{},
},
want: "?body=",
},
{
name: "no values",
args: args{
baseURL: "http://example.com/hey",
state: IssueMetadataState{},
},
want: "http://example.com/hey?body=",
},
{
name: "title and body",
args: args{
baseURL: "http://example.com/hey",
state: IssueMetadataState{
Title: "my title",
Body: "my bodeh",
},
},
want: "http://example.com/hey?body=my+bodeh&title=my+titl
e",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := WithPrAndIssueQueryParams(nil, nil, tt.args.b
aseURL, tt.args.state)
if (err != nil) != tt.wantErr {
t.Errorf("WithPrAndIssueQueryParams() error = %v,
wantErr %v", err, tt.wantErr)
return
}
if got != tt.want {
t.Errorf("WithPrAndIssueQueryParams() = %v, want
%v", got, tt.want)
}
})
}
}
 End of changes. 3 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)