aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-01-13 19:58:45 +0100
committerGitHub <noreply@github.com>2020-01-13 19:58:45 +0100
commitfacbd87cfca7ffef1760419422c2057b1ef6d501 (patch)
treeba913049fe37056364e6bf2b9db7e4bf91a924d1 /tests
parent138bff43270279f46358c39cc03666fb3ee331b2 (diff)
parent536237c35dc74205e25593667add97695a27f0f2 (diff)
Merge pull request #2268 from dkanada/absolute-path-fix
Fix tests for absolute paths
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs b/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs
index f2a8e447f..e324002f0 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs
@@ -1,6 +1,8 @@
+using System;
using AutoFixture;
using AutoFixture.AutoMoq;
using Emby.Server.Implementations.IO;
+using MediaBrowser.Model.System;
using Xunit;
namespace Jellyfin.Server.Implementations.Tests.IO
@@ -26,7 +28,16 @@ namespace Jellyfin.Server.Implementations.Tests.IO
string expectedAbsolutePath)
{
var generatedPath = _sut.MakeAbsolutePath(folderPath, filePath);
- Assert.Equal(expectedAbsolutePath, generatedPath);
+
+ if (MediaBrowser.Common.System.OperatingSystem.Id == OperatingSystemId.Windows)
+ {
+ var expectedWindowsPath = expectedAbsolutePath.Replace('/', '\\');
+ Assert.Equal(expectedWindowsPath, generatedPath.Split(':')[1]);
+ }
+ else
+ {
+ Assert.Equal(expectedAbsolutePath, generatedPath);
+ }
}
}
}