21 lines
510 B
Go
21 lines
510 B
Go
package util
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestDotPathToStandardPath(t *testing.T) {
|
|
asserts := assert.New(t)
|
|
|
|
asserts.Equal("/", DotPathToStandardPath(""))
|
|
asserts.Equal("/目录", DotPathToStandardPath("目录"))
|
|
asserts.Equal("/目录/目录2", DotPathToStandardPath("目录,目录2"))
|
|
}
|
|
|
|
func TestFillSlash(t *testing.T) {
|
|
asserts := assert.New(t)
|
|
asserts.Equal("/", FillSlash("/"))
|
|
asserts.Equal("/", FillSlash(""))
|
|
asserts.Equal("/123/", FillSlash("/123"))
|
|
}
|