@@ -11,10 +11,9 @@ import com.nextcloud.utils.extensions.webDavParentPath
1111import org.junit.Assert.assertEquals
1212import org.junit.Test
1313
14+ @Suppress(" TooManyFunctions" )
1415class WebDavParentPathTests {
1516
16- // ββ Happy path ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
17-
1817 @Test
1918 fun testWebDavParentPathWhenGivenCorrectParentShouldReturnOneLevelAbove () {
2019 assertEquals(" /Photos/Vacation/" , " /Photos/Vacation/beach.jpg" .webDavParentPath())
@@ -26,8 +25,6 @@ class WebDavParentPathTests {
2625 assertEquals(" /a/b/c/d/" , " /a/b/c/d/e.txt" .webDavParentPath())
2726 }
2827
29- // ββ Root cases ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
30-
3128 @Test
3229 fun testWebDavParentPathWhenGivenRootFileShouldReturnRoot () {
3330 assertEquals(" /" , " /image.png" .webDavParentPath())
@@ -48,8 +45,6 @@ class WebDavParentPathTests {
4845 assertEquals(" /" , " ///" .webDavParentPath())
4946 }
5047
51- // ββ Relative paths ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
52-
5348 @Test
5449 fun testWebDavParentPathWhenGivenRelativePathShouldReturnOneLevelAbove () {
5550 assertEquals(" Documents/" , " Documents/file.pdf" .webDavParentPath())
@@ -60,8 +55,6 @@ class WebDavParentPathTests {
6055 assertEquals(" /" , " readme.md" .webDavParentPath())
6156 }
6257
63- // ββ Trailing slashes ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
64-
6558 @Test
6659 fun testWebDavParentPathWhenGivenTrailingSlashShouldReturnOneLevelAbove () {
6760 assertEquals(" /Photos/" , " /Photos/Vacation/" .webDavParentPath())
@@ -72,8 +65,6 @@ class WebDavParentPathTests {
7265 assertEquals(" /Photos/" , " /Photos/Vacation///" .webDavParentPath())
7366 }
7467
75- // ββ Encoded characters (WebDAV percent-encoding must be preserved) ββββββββ
76-
7768 @Test
7869 fun testWebDavParentPathWhenGivenEncodedSpacesShouldPreserveEncoding () {
7970 assertEquals(" /My%20Photos/" , " /My%20Photos/beach%20photo.jpg" .webDavParentPath())
@@ -84,15 +75,11 @@ class WebDavParentPathTests {
8475 assertEquals(" /files/%23reports/" , " /files/%23reports/q1%262.pdf" .webDavParentPath())
8576 }
8677
87- // ββ Unicode βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
88-
8978 @Test
9079 fun testWebDavParentPathWhenGivenUnicodeCharsShouldReturnOneLevelAbove () {
9180 assertEquals(" /η
§η/εζ/" , " /η
§η/εζ/ζ΅·ζ»©.jpg" .webDavParentPath())
9281 }
9382
94- // ββ Single character ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
95-
9683 @Test
9784 fun testWebDavParentPathWhenGivenSingleCharFileAtRootShouldReturnRoot () {
9885 assertEquals(" /" , " /a" .webDavParentPath())
0 commit comments