diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-04-22 03:11:21 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-04-22 03:11:21 +0200 |
| commit | 81209258abeade8614d848f7e7cceeb6bb37a7d7 (patch) | |
| tree | ac14358d722061ba1ab0e4e96aae095e8590a68a /tests/Jellyfin.Server.Implementations.Tests/IO | |
| parent | 95ab603a40b96499e3a3b732f31aacc458ca8a2c (diff) | |
ManagedFileSystem: Rewrite GetValidFilename and more improvements
Diffstat (limited to 'tests/Jellyfin.Server.Implementations.Tests/IO')
| -rw-r--r-- | tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs b/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs index 614a68975..30e6542f9 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs @@ -42,6 +42,16 @@ namespace Jellyfin.Server.Implementations.Tests.IO } } + [Theory] + [InlineData("ValidFileName", "ValidFileName")] + [InlineData("AC/DC", "AC DC")] + [InlineData("Invalid\0", "Invalid ")] + [InlineData("AC/DC\0KD/A", "AC DC KD A")] + public void GetValidFilename_ReturnsValidFilename(string filename, string expectedFileName) + { + Assert.Equal(expectedFileName, _sut.GetValidFilename(filename)); + } + [SkippableFact] public void GetFileInfo_DanglingSymlink_ExistsFalse() { |
