diff options
Diffstat (limited to 'lib/model/testutils_test.go')
-rw-r--r-- | lib/model/testutils_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/model/testutils_test.go b/lib/model/testutils_test.go index 6c2a29071e..4ee390f5d8 100644 --- a/lib/model/testutils_test.go +++ b/lib/model/testutils_test.go @@ -435,3 +435,18 @@ func addDevice2(t testing.TB, w config.Wrapper, fcfg config.FolderConfiguration) must(t, err) waiter.Wait() } + +func writeFile(t testing.TB, filesystem fs.Filesystem, name string, data []byte) { + t.Helper() + fd, err := filesystem.Create(name) + must(t, err) + defer fd.Close() + _, err = fd.Write(data) + must(t, err) +} + +func writeFilePerm(t testing.TB, filesystem fs.Filesystem, name string, data []byte, perm fs.FileMode) { + t.Helper() + writeFile(t, filesystem, name, data) + must(t, filesystem.Chmod(name, perm)) +} |