mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
test: add more test case for CleanPath
Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
@@ -129,4 +129,14 @@ func TestCleanPath(t *testing.T) {
|
||||
if path != "/var" {
|
||||
t.Errorf("expected to receive '/var' and received %s", path)
|
||||
}
|
||||
|
||||
path = CleanPath("/foo/bar/")
|
||||
if path != "/foo/bar" {
|
||||
t.Errorf("expected to receive '/foo/bar' and received %s", path)
|
||||
}
|
||||
|
||||
path = CleanPath("/foo/bar/../")
|
||||
if path != "/foo" {
|
||||
t.Errorf("expected to receive '/foo' and received %s", path)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user