aboutsummaryrefslogtreecommitdiffstats
path: root/tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-06-04 18:17:23 -0500
committerJP Dillingham <jp@dillingham.me>2026-06-04 19:30:21 -0500
commit913faaf93a702971b85508815710f79b5d86a2ba (patch)
tree8b760ff734f0c3a58f78764e6718d359b68b9b9a /tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs
parent483e37f64def66cecb01a8c471d35e2937178960 (diff)
downloadslskd-913faaf93a702971b85508815710f79b5d86a2ba.tar.gz
tests
Diffstat (limited to 'tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs')
-rw-r--r--tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs b/tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs
index 0fc307bd..469f5335 100644
--- a/tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs
+++ b/tests/slskd.Tests.Unit/Common/FileSafety/StripPathRootTests.cs
@@ -69,7 +69,7 @@ public partial class FileSafetyTests
[InlineData("\\\\server\\share\\Music", "share\\Music")]
[InlineData("\\\\server\\Music", "Music")]
[InlineData("\\\\192.168.1.1\\share\\folder", "share\\folder")]
- [InlineData("\\\\server", "")] // no path after server
+ [InlineData("\\\\server", "")] // no path after server
public void Windows_Strips_UncRoot(string input, string expected)
{
var result = FileSafety.StripPathRoot(input, OperatingSystem.Windows);
@@ -78,6 +78,18 @@ public partial class FileSafetyTests
}
[Theory]
+ [InlineData("//server/share/Music", "share\\Music")]
+ [InlineData("//server/Music", "Music")]
+ [InlineData("//192.168.1.1/share/folder", "share\\folder")]
+ [InlineData("//server", "")]
+ public void Windows_Strips_ForwardSlash_UncRoot(string input, string expected)
+ {
+ var result = FileSafety.StripPathRoot(input, OperatingSystem.Windows);
+
+ Assert.Equal(expected, result);
+ }
+
+ [Theory]
[InlineData("@@abcde/Music/Artist", "Music/Artist")]
[InlineData("@@abcdefgh/Music", "Music")]
[InlineData("@@abcde\\Music\\Artist", "Music/Artist")]