auth test: skip unix perm check on Windows

This commit is contained in:
Grok Bot (for George) 2026-10-03 18:52:51 -04:00
commit fecc2ef201

View file

@ -3,6 +3,7 @@ package auth
import (
"os"
"path/filepath"
"runtime"
"testing"
)
@ -10,7 +11,7 @@ func TestSaveXVeraeToken(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home) // os.UserHomeDir on Windows
t.Setenv("XVERAE_TOKEN", "") // force file path
t.Setenv("XVERAE_TOKEN", "") // force file path
if err := SaveXVeraeToken("xVerae-testtoken123"); err != nil {
t.Fatal(err)
}
@ -23,7 +24,7 @@ func TestSaveXVeraeToken(t *testing.T) {
t.Fatalf("%q", b)
}
st, _ := os.Stat(p)
if st.Mode().Perm()&0o077 != 0 {
if runtime.GOOS != "windows" && st.Mode().Perm()&0o077 != 0 { // NTFS uses ACLs, not mode bits
t.Fatalf("perms %v", st.Mode())
}
}