File: path_unix_test.go

package info (click to toggle)
docker-buildx 0.19.3%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,852 kB
  • sloc: sh: 318; makefile: 73
file content (20 lines) | stat: -rw-r--r-- 438 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//go:build !windows
// +build !windows

package gitutil

import (
	"testing"

	"github.com/docker/buildx/util/osutil"
	"github.com/stretchr/testify/assert"
)

func TestSanitizePathUnix(t *testing.T) {
	assert.Equal(t, "/home/foobar", osutil.SanitizePath("/home/foobar"))
}

func TestSanitizePathWSL(t *testing.T) {
	t.Setenv("WSL_DISTRO_NAME", "Ubuntu")
	assert.Equal(t, "/mnt/c/Users/foobar", osutil.SanitizePath("C:\\Users\\foobar"))
}