From 1e3b08fe60f4a60c3f1069d7731c2581d30eb996 Mon Sep 17 00:00:00 2001 From: AhmedWaleed22 Date: Wed, 16 Sep 2026 21:23:01 +0000 Subject: [PATCH] test: handle Windows filesystem semantics --- internal/application/scaffold_test.go | 6 ++++++ internal/project/tree.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/application/scaffold_test.go b/internal/application/scaffold_test.go index 2f5b9f7..157570f 100644 --- a/internal/application/scaffold_test.go +++ b/internal/application/scaffold_test.go @@ -3,6 +3,7 @@ package application import ( "os" "path/filepath" + "runtime" "testing" ) @@ -25,6 +26,11 @@ func TestScaffoldCreatesExpectedFilesAndModes(t *testing.T) { t.Errorf("%s: %v", name, err) continue } + // Windows does not implement Unix permission bits. os.WriteFile applies + // the requested mode on Unix, but reports files as 0666 on Windows. + if runtime.GOOS == "windows" { + continue + } want := os.FileMode(0644) if name == "infra/install.sh" { want = 0755 diff --git a/internal/project/tree.go b/internal/project/tree.go index 959a3d4..348a384 100644 --- a/internal/project/tree.go +++ b/internal/project/tree.go @@ -37,7 +37,7 @@ func ValidateTree(dir string) error { } if entry.Type()&os.ModeSymlink != 0 { relative, _ := filepath.Rel(dir, path) - return fmt.Errorf("symlinks are not supported: %s", relative) + return fmt.Errorf("symlinks are not supported: %s", filepath.ToSlash(relative)) } return nil })