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

Function fixtureAttachmentArgs

internal/attachments/references_fixture_test.go:17–39  ·  view source on GitHub ↗

fixtureAttachmentArgs is the set of attached files testdata/references_input.md is written against. Every asset URL is recognisable on sight so the expected output stays readable, and the paths cover the spellings markdown allows.

()

Source from the content-addressed store, hash-verified

15// written against. Every asset URL is recognisable on sight so the expected
16// output stays readable, and the paths cover the spellings markdown allows.
17func fixtureAttachmentArgs() []attachmentArg {
18 img := func(path, name string) attachmentArg {
19 return attachmentArg{Path: path, URL: "https://example.com/" + name, Alt: name}
20 }
21 return []attachmentArg{
22 img("login.png", "login"),
23 {Path: "./repro.mp4", URL: "https://example.com/repro", Alt: "repro.mp4", RendersAsPlayer: true},
24 img("./Screenshot 2026-08-10 at 5.38.10 PM.png", "screenshot"),
25 img("./f(1).png", "parens"),
26 img("./f((1)(2)).png", "nested-parens"),
27 img("./f).png", "escaped-paren"),
28 img("./f", "truncated"),
29 img(`./a\b.png`, "backslash"),
30 img("./a>b.png", "escaped-angle"),
31 img("./login(1).png", "escaped-parens"),
32 img("./f(1.png", "unbalanced-open"),
33 img("./my file.png", "bare-space"),
34 img("./unused.png", "unused"),
35 // An upload that produced no URL. Its reference is left as written and
36 // is not reported for appending, since there is nothing to append.
37 {Path: "./nourl.png", Alt: "nourl"},
38 }
39}
40
41// One markdown document covering every syntax this package handles, so the
42// behaviour can be read as markdown rather than as Go string literals.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected