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

Function writeTestFile

pkg/cmd/issue/artifact/edit/edit_test.go:1755–1759  ·  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

1753// writeTestFile creates a file in the working directory, with any missing
1754// parent directories.
1755func writeTestFile(t *testing.T, path, content string) {
1756 t.Helper()
1757 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0755))
1758 require.NoError(t, os.WriteFile(path, []byte(content), 0644))
1759}
1760
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.

Callers 2

TestNewCmdEditFunction · 0.70
TestEditRunFunction · 0.70

Calls 3

MkdirAllMethod · 0.80
WriteFileMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected