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