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

Function writeTestFile

pkg/cmd/issue/artifact/create/create_test.go:1581–1585  ·  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

1579// writeTestFile creates a file in the working directory, with any missing
1580// parent directories.
1581func writeTestFile(t *testing.T, path, content string) {
1582 t.Helper()
1583 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0755))
1584 require.NoError(t, os.WriteFile(path, []byte(content), 0644))
1585}
1586
1587// symlinkTestFile creates a symlink, or skips the test where that needs a
1588// privilege the system doesn't grant, as on Windows by default.

Callers 2

TestNewCmdCreateFunction · 0.70
TestCreateRunFunction · 0.70

Calls 3

MkdirAllMethod · 0.80
WriteFileMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected