mirror of
https://github.com/cheat/cheat.git
synced 2026-03-07 03:03:32 +01:00
fix: cross-platform CI test fixes and parse bug fix
- Add .gitattributes to force LF in mock files (Windows autocrlf) - Fix parse.go: detect line endings from content instead of runtime.GOOS - Add fail-fast: false to CI matrix; trigger on all branch pushes - Skip chmod-based tests on Windows (permissions work differently) - Use filepath.Join for expected paths in Windows path tests - Use platform-appropriate invalid paths in error tests - Add Windows absolute path test case for ValidateSheetName - Skip Unix-specific integration tests on Windows Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cheatpath
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -53,9 +54,15 @@ func TestValidateSheetName(t *testing.T) {
|
||||
errMsg: "'..'",
|
||||
},
|
||||
{
|
||||
name: "absolute path",
|
||||
name: "absolute path unix",
|
||||
input: "/etc/passwd",
|
||||
wantErr: true,
|
||||
wantErr: runtime.GOOS != "windows", // /etc/passwd is not absolute on Windows
|
||||
errMsg: "absolute",
|
||||
},
|
||||
{
|
||||
name: "absolute path windows",
|
||||
input: `C:\evil`,
|
||||
wantErr: runtime.GOOS == "windows", // C:\evil is not absolute on Unix
|
||||
errMsg: "absolute",
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user