MCPcopy Create free account
hub / github.com/cli/cli / TestIsShortcutFile

Function TestIsShortcutFile

pkg/cmd/issue/artifact/shared/content_test.go:148–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

146}
147
148func TestIsShortcutFile(t *testing.T) {
149 tests := []struct {
150 name string
151 path string
152 want bool
153 }{
154 {
155 name: "a .url file",
156 path: "oauth-runbook.url",
157 want: true,
158 },
159 {
160 name: "any case, as on Windows",
161 path: "docs/OAuth-Runbook.URL",
162 want: true,
163 },
164 {
165 name: "a Markdown file",
166 path: "signin-plan.md",
167 },
168 {
169 name: "url elsewhere in the name",
170 path: "url-notes.md",
171 },
172 {
173 name: "no extension",
174 path: "url",
175 },
176 }
177
178 for _, tt := range tests {
179 t.Run(tt.name, func(t *testing.T) {
180 assert.Equal(t, tt.want, IsShortcutFile(tt.path))
181 })
182 }
183}
184
185func TestIsHTMLFile(t *testing.T) {
186 tests := []struct {

Callers

nothing calls this directly

Calls 3

IsShortcutFileFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected