You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool/nfs/util_nonwin_test.go

20 lines
442 B
Go

//go:build !windows
package nfs_test
import (
"git.noahlan.cn/noahlan/ntool/nfs"
"git.noahlan.cn/noahlan/ntool/ntest/assert"
"testing"
)
func TestSlashPath_nw(t *testing.T) {
assert.Eq(t, "path/to/dir", nfs.JoinPaths("path", "to", "dir"))
assert.Eq(t, "path/to/dir", nfs.JoinSubPaths("path", "to", "dir"))
}
func TestRealpath_nw(t *testing.T) {
inPath := "/path/to/some/../dir"
assert.Eq(t, "/path/to/dir", nfs.Realpath(inPath))
}