From 4ee088b1a87625bbc7595bba50b2ab05f0ccc7cc Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 24 Sep 2026 20:44:52 +0200 Subject: tests: add TestUnlinkedO_SYNC Relates-to: #1023 https://github.com/rfjakob/gocryptfs/issues/1023 --- tests/matrix/matrix_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go index a2ec549..2f097fb 100644 --- a/tests/matrix/matrix_test.go +++ b/tests/matrix/matrix_test.go @@ -993,3 +993,18 @@ func TestRenameExchangeOnGocryptfs(t *testing.T) { t.Errorf("file2 content wrong after exchange. Expected: %s, Got: %s", content1, newContent2) } } + +func TestUnlinkedO_SYNC(t *testing.T) { + path := test_helpers.DefaultPlainDir + "/" + t.Name() + fd, err := syscall.Open(path, syscall.O_CREAT|syscall.O_RDWR|syscall.O_SYNC, 0600) + if err != nil { + t.Fatal(err) + } + defer syscall.Close(fd) + if err = os.Remove(path); err != nil { + t.Fatal(err) + } + if _, err = syscall.Write(fd, make([]byte, 10)); err != nil { + t.Error(err) + } +} -- cgit v1.2.3