fix(platform): support Windows storage and native filesystem boundaries

This commit is contained in:
eezd committed 2026-10-27 14:47:25 +08:00
1 parent 3726423338
commit e239fff253
24 files changed
+355 -51

No files matched your search

+3 -7
View File
@@ -4,6 +4,7 @@ import (
"errors"
"os"
"path/filepath"
"rawmark/internal/testutil"
"reflect"
"strings"
"testing"
@@ -145,9 +146,7 @@ func TestTreeIconValidationAndCorruptMetadata(t *testing.T) {
}
func TestTreeIconWriteFailureRollsBack(t *testing.T) {
if os.Geteuid() == 0 {
t.Skip("目录写权限测试需以普通用户运行;root 可绕过文件权限")
}
for _, operation := range []string{"set", "move", "delete", "restore"} {
t.Run(operation, func(t *testing.T) {
v := newVault(t)
@@ -169,10 +168,7 @@ func TestTreeIconWriteFailureRollsBack(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if err := os.Chmod(filepath.Join(v.root, metaDir), 0555); err != nil {
t.Fatal(err)
}
defer os.Chmod(filepath.Join(v.root, metaDir), 0755)
testutil.DenyReplace(t, filepath.Join(v.root, metaDir, "tree-icons.json"))
switch operation {
case "set":
err = v.SetTreeIcon("a.md", &TreeIcon{"builtin", "folder"})