aboutsummaryrefslogtreecommitdiff
path: root/modules/util/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/util/path_test.go')
-rw-r--r--modules/util/path_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/util/path_test.go b/modules/util/path_test.go
index 93f4f67cf..2f020f924 100644
--- a/modules/util/path_test.go
+++ b/modules/util/path_test.go
@@ -136,3 +136,15 @@ func TestMisc_IsReadmeFileName(t *testing.T) {
assert.Equal(t, testCase.idx, idx)
}
}
+
+func TestCleanPath(t *testing.T) {
+ cases := map[string]string{
+ "../../test": "test",
+ "/test": "/test",
+ "/../test": "/test",
+ }
+
+ for k, v := range cases {
+ assert.Equal(t, v, CleanPath(k))
+ }
+}