Skip to content

Commit d7d38ec

Browse files
committed
fix: make file system error test cross-platform compatible
Replace Unix-specific path with null byte character in filename which is forbidden on both Windows and Unix systems.
1 parent 13b6db0 commit d7d38ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ func TestErrorHandling(t *testing.T) {
263263
BodyHTML: "<p>Test</p>",
264264
}
265265

266-
// Try to write to a non-existent directory with no permissions
267-
err := post.WriteToFile("/root/non-existent/file.html", "html", false)
266+
// Try to write to a file with invalid character (null byte forbidden on both Windows and Unix)
267+
err := post.WriteToFile("invalid\x00filename.html", "html", false)
268268
assert.Error(t, err)
269269
})
270270
}

0 commit comments

Comments
 (0)