github.com/cidverse/cid-sdk-go@v0.0.0-20240318001225-c193d83f053e/util_test.go (about) 1 package cidsdk 2 3 import ( 4 "fmt" 5 "os" 6 "testing" 7 8 "github.com/stretchr/testify/assert" 9 ) 10 11 func TestJoinPathForTestCases(t *testing.T) { 12 JoinSeparator = "/" 13 assert.Equal(t, `my-dir/my-file`, JoinPath("my-dir", "my-file")) 14 } 15 16 func TestJoinPath(t *testing.T) { 17 JoinSeparator = "" 18 assert.Equal(t, fmt.Sprintf(`my-dir%cmy-file`, os.PathSeparator), JoinPath("my-dir", "my-file")) 19 }