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

Function symlinkTestFile

pkg/cmd/issue/artifact/edit/edit_test.go:1763–1769  ·  view source on GitHub ↗

symlinkTestFile creates a symlink, or skips the test where that needs a privilege the system doesn't grant, as on Windows by default.

(t *testing.T, target, path string)

Source from the content-addressed store, hash-verified

1761// symlinkTestFile creates a symlink, or skips the test where that needs a
1762// privilege the system doesn't grant, as on Windows by default.
1763func symlinkTestFile(t *testing.T, target, path string) {
1764 t.Helper()
1765 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0755))
1766 if err := os.Symlink(target, path); err != nil {
1767 t.Skipf("cannot create a symlink here: %v", err)
1768 }
1769}

Callers 1

TestEditRunFunction · 0.70

Calls 2

MkdirAllMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected