ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Add dockable Art tools, animation and previews, guarded asset workflows, and the Web Asset Studio built on the shared Art Core. Expand English and Russian documentation, interactive Try scenes, examples and editor icons. Add audio waveform navigation, source analysis, guarded previews and a browser Worker mixer. Preserve source changes and recovery with bounded checks, and strengthen native, browser and interoperability CI. Prepare version 0.12.5 and manually built native artifact candidates. Fix the production site image demo build dependency. Reuse immutable scene indices when capturing keyframes. Wait for real Persist save/load completion in component tests. Stabilize browser Game View captures outside pointer hover. Aseprite interchange and persistent Audio EDL recovery remain limited; the artifact workflow does not publish releases or change stable.
87 lines
2.3 KiB
Go
87 lines
2.3 KiB
Go
package modulecheck
|
|
|
|
import (
|
|
"os/exec"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// windowsPathComponent checks names in the Git tree, not the host filesystem:
|
|
// Windows cannot even check out a tree containing these names.
|
|
func windowsPathComponent(name string) bool {
|
|
if name == "" || strings.HasSuffix(name, ".") || strings.HasSuffix(name, " ") {
|
|
return false
|
|
}
|
|
if strings.ContainsAny(name, `<>:"\|?*`) {
|
|
return false
|
|
}
|
|
for _, c := range name {
|
|
if c < 32 {
|
|
return false
|
|
}
|
|
}
|
|
base, _, _ := strings.Cut(name, ".")
|
|
base = strings.ToUpper(strings.TrimRight(base, " "))
|
|
switch base {
|
|
case "CON", "PRN", "AUX", "NUL", "CONIN$", "CONOUT$":
|
|
return false
|
|
}
|
|
if strings.HasPrefix(base, "COM") || strings.HasPrefix(base, "LPT") {
|
|
suffix := base[3:]
|
|
if len(suffix) == 1 && suffix[0] >= '1' && suffix[0] <= '9' || suffix == "¹" || suffix == "²" || suffix == "³" {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
func TestWindowsPathComponents(t *testing.T) {
|
|
for _, name := range []string{"aux.go", "CON", "lpt1.txt", "COM9", "COM¹.txt", "LPT²", "bad.", "bad ", `bad:name`} {
|
|
if windowsPathComponent(name) {
|
|
t.Errorf("%q should not be portable", name)
|
|
}
|
|
}
|
|
for _, name := range []string{"auxiliary.go", "com10", "lpt0.txt", "console.go"} {
|
|
if !windowsPathComponent(name) {
|
|
t.Errorf("%q should be portable", name)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestGitTreeIsWindowsPortable(t *testing.T) {
|
|
if _, err := exec.LookPath("git"); err != nil {
|
|
t.Skip("git is not installed")
|
|
}
|
|
root := repoRoot(t)
|
|
probe := exec.Command("git", "rev-parse", "--is-inside-work-tree")
|
|
probe.Dir = root
|
|
if err := probe.Run(); err != nil {
|
|
t.Skip("not a Git checkout")
|
|
}
|
|
cmd := exec.Command("git", "ls-files", "-z")
|
|
cmd.Dir = root
|
|
out, err := cmd.Output()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
seen := make(map[string]string)
|
|
for _, path := range strings.Split(string(out), "\x00") {
|
|
if path == "" {
|
|
continue
|
|
}
|
|
parts := strings.Split(path, "/")
|
|
for i, part := range parts {
|
|
prefix := strings.Join(parts[:i+1], "/")
|
|
if !windowsPathComponent(part) {
|
|
t.Errorf("%s contains a Windows-incompatible name %q", path, part)
|
|
}
|
|
folded := strings.ToLower(prefix)
|
|
if other, ok := seen[folded]; ok && other != prefix {
|
|
t.Errorf("case-insensitive path collision: %s and %s", other, prefix)
|
|
} else {
|
|
seen[folded] = prefix
|
|
}
|
|
}
|
|
}
|
|
}
|