writeTestFile creates a file in the working directory, with any missing parent directories.
(t *testing.T, path, content string)
| 1527 | // writeTestFile creates a file in the working directory, with any missing |
| 1528 | // parent directories. |
| 1529 | func 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. |
no test coverage detected