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

Function writeTestFile

pkg/cmd/issue/artifact/download/download_test.go:1529–1533  ·  view source on GitHub ↗

writeTestFile creates a file in the working directory, with any missing parent directories.

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

Source from the content-addressed store, hash-verified

1527// writeTestFile creates a file in the working directory, with any missing
1528// parent directories.
1529func writeTestFile(t *testing.T, path, content string) {
1530 t.Helper()
1531 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0755))
1532 require.NoError(t, os.WriteFile(path, []byte(content), 0644))
1533}
1534
1535// symlinkTestFile creates a symlink, or skips the test where that needs a
1536// privilege the system doesn't grant, as on Windows by default.

Callers 1

TestDownloadRunFunction · 0.70

Calls 3

MkdirAllMethod · 0.80
WriteFileMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected