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

Function TestIsHTMLFile

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

Source from the content-addressed store, hash-verified

183}
184
185func TestIsHTMLFile(t *testing.T) {
186 tests := []struct {
187 name string
188 path string
189 want bool
190 }{
191 {
192 name: "a .html file",
193 path: "menu-prototype.html",
194 want: true,
195 },
196 {
197 name: "a .htm file",
198 path: "docs/specials.htm",
199 want: true,
200 },
201 {
202 name: "any case",
203 path: "MENU.HTML",
204 want: true,
205 },
206 {
207 name: "any case, for .htm too",
208 path: "Specials.Htm",
209 want: true,
210 },
211 {
212 name: "a Markdown file",
213 path: "signin-plan.md",
214 },
215 {
216 name: "html elsewhere in the name",
217 path: "menu.html.md",
218 },
219 {
220 name: "another extension that ends in html",
221 path: "menu.xhtml",
222 },
223 {
224 name: "no extension",
225 path: "html",
226 },
227 }
228
229 for _, tt := range tests {
230 t.Run(tt.name, func(t *testing.T) {
231 assert.Equal(t, tt.want, IsHTMLFile(tt.path))
232 })
233 }
234}
235
236func TestShortcutURL(t *testing.T) {
237 const runbook = "https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook"

Callers

nothing calls this directly

Calls 3

IsHTMLFileFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected