buildx/util/gitutil/path_unix_test.go
CrazyMax fb2c62a038
build: resolve 8.3 filename format to long one on Windows
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-01-25 15:06:32 +01:00

20 lines
384 B
Go

//go:build !windows
// +build !windows
package gitutil
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSanitizePathUnix(t *testing.T) {
assert.Equal(t, "/home/foobar", SanitizePath("/home/foobar"))
}
func TestSanitizePathWSL(t *testing.T) {
t.Setenv("WSL_DISTRO_NAME", "Ubuntu")
assert.Equal(t, "/mnt/c/Users/foobar", SanitizePath("C:\\Users\\foobar"))
}