From d775ded5a4504fa3c8ed84f31b4558735df788da Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 10 Nov 2023 08:31:25 +0100 Subject: [PATCH] Allow small difference when writing the file. --- .../Optimizers/ImageOptimizerTestHelper{TOptimizer}.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Magick.NET.Tests/Optimizers/ImageOptimizerTestHelper{TOptimizer}.cs b/tests/Magick.NET.Tests/Optimizers/ImageOptimizerTestHelper{TOptimizer}.cs index ce2f0407d7..284c86ce2d 100644 --- a/tests/Magick.NET.Tests/Optimizers/ImageOptimizerTestHelper{TOptimizer}.cs +++ b/tests/Magick.NET.Tests/Optimizers/ImageOptimizerTestHelper{TOptimizer}.cs @@ -29,8 +29,8 @@ protected void AssertCompressNotSmaller(string fileName) var lengthB = AssertCompressNotSmaller(fileName, (string file) => Optimizer.Compress(file)); var lengthC = AssertCompressNotSmaller(fileName, (Stream stream) => Optimizer.Compress(stream)); - Assert.Equal(lengthA, lengthB); - Assert.Equal(lengthB, lengthC); + Assert.InRange(lengthA, lengthB - 1, lengthB + 1); + Assert.InRange(lengthB, lengthC - 1, lengthC + 1); } protected void AssertCompressTwice(string fileName)