Remove some unused shit and write tests for coverage
This commit is contained in:
@@ -224,52 +224,6 @@ func TestResolvePathComplexTilde(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsAbsolutePath(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "Empty path",
|
||||
input: "",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "Absolute Unix path",
|
||||
input: "/absolute/path",
|
||||
expected: func() bool {
|
||||
if runtime.GOOS == "windows" {
|
||||
// On Windows, paths starting with / are not considered absolute
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}(),
|
||||
},
|
||||
{
|
||||
name: "Relative path",
|
||||
input: "relative/path",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "Tilde expansion (becomes absolute)",
|
||||
input: "~/path",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "Windows absolute path",
|
||||
input: "C:\\Windows\\System32",
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := IsAbsolutePath(tt.input)
|
||||
assert.Equal(t, tt.expected, result)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetRelativePath(t *testing.T) {
|
||||
// Create temporary directories for testing
|
||||
|
||||
Reference in New Issue
Block a user