2018-12-06 20:44:08 +00:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2018-12-11 19:22:50 +00:00
|
|
|
func TestIsParentPath(t *testing.T) {
|
|
|
|
require.True(t, isParentPath("/a/b/c", "/a/b/c"))
|
|
|
|
require.True(t, isParentPath("/a/b/c", "/a/b/c/d"))
|
|
|
|
require.True(t, isParentPath("/a/b/c", "/a/b/c/d/e"))
|
|
|
|
|
|
|
|
require.False(t, isParentPath("/a/b/c", "/a/b/d"))
|
|
|
|
require.False(t, isParentPath("/a/b/c", "/a/b/cd"))
|
|
|
|
require.False(t, isParentPath("/a/b/c", "/a/d/c"))
|
|
|
|
require.False(t, isParentPath("/a/b/c", "/d/e/c"))
|
|
|
|
}
|