diff --git a/ProxyForge.Tests/ProxyCacheTests.cs b/ProxyForge.Tests/ProxyCacheTests.cs index 16aef9c..3fc4f1d 100644 --- a/ProxyForge.Tests/ProxyCacheTests.cs +++ b/ProxyForge.Tests/ProxyCacheTests.cs @@ -254,6 +254,18 @@ public sealed class ProxyCacheTests : IDisposable Assert.Equal(0, cache.Trim()); } + [Fact] + public void ACacheExactlyAtTheLimitIsNotTrimmed() + { + var cache = CreateCache(); + cache.Add(Describe(CreateSource("a.mp4")), WriteProxy(cache, 100)); + cache.Add(Describe(CreateSource("b.mp4")), WriteProxy(cache, 100)); + cache.LimitBytes = 200; + + Assert.Equal(0, cache.Trim()); + Assert.Equal(2, cache.Count); + } + [Fact] public void TrimSkipsAFileThatCannotBeDeleted() { diff --git a/ProxyForge.Tests/ProxyEncoderTests.cs b/ProxyForge.Tests/ProxyEncoderTests.cs index 3a85a61..2366f4f 100644 --- a/ProxyForge.Tests/ProxyEncoderTests.cs +++ b/ProxyForge.Tests/ProxyEncoderTests.cs @@ -367,6 +367,7 @@ public sealed class ProxyEncoderTests Assert.False(result.IsSuccess); Assert.NotEqual(string.Empty, result.FirstDiagnosticLine(200)); + Assert.DoesNotContain('\r', result.Diagnostics); } [Fact] diff --git a/ProxyForge.Tests/ProxyFrameRendererTests.cs b/ProxyForge.Tests/ProxyFrameRendererTests.cs index a579ade..88cdcca 100644 --- a/ProxyForge.Tests/ProxyFrameRendererTests.cs +++ b/ProxyForge.Tests/ProxyFrameRendererTests.cs @@ -131,6 +131,8 @@ public sealed class ProxyFrameRendererTests [InlineData(50, 640, 360, 1)] [InlineData(25, 1920, 1080, 2)] [InlineData(10, 1920, 1080, 3)] + [InlineData(50, 100, 31, 0)] + [InlineData(50, 31, 100, 0)] public void HalvesUntilTheRemainingScaleIsAtLeastAHalf(int scale, int width, int height, int expectedHalvings) { using var devices = new GraphicsDevices();