chore: import Local-Cursor v1.1.8 source snapshot

Includes the current working directory changes. Historical commits and release binaries are excluded to limit Gitea storage.
Source base: d7515973fbfd6dd2001fa156c483455b8081c7cb
This commit is contained in:
FuDie0915
2026-11-10 01:24:28 +08:00
commit db73cf5a39
337 changed files with 147502 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package forwarder
import "testing"
func TestIsAbsoluteToolPath(t *testing.T) {
tests := []struct {
name string
path string
want bool
}{
{name: "empty", path: "", want: false},
{name: "spaces", path: " ", want: false},
{name: "relative", path: "internal/backend/forwarder/path_resolution.go", want: false},
{name: "dot relative", path: "./path_resolution.go", want: false},
{name: "parent relative", path: "../path_resolution.go", want: false},
{name: "windows drive relative", path: `C:path_resolution.go`, want: false},
{name: "windows drive only", path: `C:`, want: false},
{name: "invalid drive prefix", path: `1:/path_resolution.go`, want: false},
{name: "posix absolute", path: "/Users/example/path_resolution.go", want: true},
{name: "posix absolute with spaces", path: " /tmp/path_resolution.go ", want: true},
{name: "windows backslash absolute", path: `C:\Users\example\path_resolution.go`, want: true},
{name: "windows slash absolute", path: `C:/Users/example/path_resolution.go`, want: true},
{name: "windows unc backslash", path: `\\server\share\path_resolution.go`, want: true},
{name: "windows unc slash", path: `//server/share/path_resolution.go`, want: true},
{name: "windows extended drive", path: `\\?\C:\Users\example\path_resolution.go`, want: true},
{name: "windows extended unc", path: `\\?\UNC\server\share\path_resolution.go`, want: true},
{name: "windows device path", path: `\\.\C:\Users\example\path_resolution.go`, want: true},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if got := isAbsoluteToolPath(test.path); got != test.want {
t.Fatalf("isAbsoluteToolPath(%q) = %v, want %v", test.path, got, test.want)
}
})
}
}