Cloudreve/pkg/util/path_test.go

22 lines
510 B
Go
Raw Normal View History

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"))
}
2019-12-05 06:01:51 -05:00
func TestFillSlash(t *testing.T) {
asserts := assert.New(t)
asserts.Equal("/", FillSlash("/"))
asserts.Equal("/", FillSlash(""))
asserts.Equal("/123/", FillSlash("/123"))
}