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

Function Test_searchQuery

pkg/cmd/repo/list/http_test.go:63–162  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61}
62
63func Test_searchQuery(t *testing.T) {
64 type args struct {
65 owner string
66 filter FilterOptions
67 }
68 tests := []struct {
69 name string
70 args args
71 want string
72 }{
73 {
74 name: "blank",
75 want: "sort:updated-desc fork:true user:@me",
76 },
77 {
78 name: "in org",
79 args: args{
80 owner: "cli",
81 },
82 want: "sort:updated-desc fork:true user:cli",
83 },
84 {
85 name: "only public",
86 args: args{
87 owner: "",
88 filter: FilterOptions{
89 Visibility: "public",
90 },
91 },
92 want: "sort:updated-desc fork:true is:public user:@me",
93 },
94 {
95 name: "only private",
96 args: args{
97 owner: "",
98 filter: FilterOptions{
99 Visibility: "private",
100 },
101 },
102 want: "sort:updated-desc fork:true is:private user:@me",
103 },
104 {
105 name: "only forks",
106 args: args{
107 owner: "",
108 filter: FilterOptions{
109 Fork: true,
110 },
111 },
112 want: "sort:updated-desc fork:only user:@me",
113 },
114 {
115 name: "no forks",
116 args: args{
117 owner: "",
118 filter: FilterOptions{
119 Source: true,
120 },

Callers

nothing calls this directly

Calls 3

searchQueryFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected