Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Tests: allow 7-Zip's daylight-saving hour in the archive round trip

KnifeLemon83f5f613bd3f
diff --git a/tests/Filee.Engines.Tests/ArchiveTests.cs b/tests/Filee.Engines.Tests/ArchiveTests.cs
index 4dd7678a..4a056ed9 100644
--- a/tests/Filee.Engines.Tests/ArchiveTests.cs
+++ b/tests/Filee.Engines.Tests/ArchiveTests.cs
@@ -111,7 +111,11 @@ public class ArchiveTests(EngineFixture fx) : IClassFixture<EngineFixture>
ZipFile.ExtractToDirectory(current, check);
Assert.Equal(expected, Snapshot(Path.Combine(check, "프로젝트")));
var time = File.GetLastWriteTime(Path.Combine(check, "프로젝트", "readme.txt"));
- Assert.True(Math.Abs((time - KnownTime).TotalSeconds) <= 2, $"time {time} instead of {KnownTime}");
+ // 7-Zip turns a ZIP's local times into UTC with Windows' current offset, which in a time zone with daylight
+ // saving time can be an hour off .NET's offset for that date (seen on a Pacific-time CI runner).
+ var off = Math.Abs((time - KnownTime).TotalSeconds);
+ var dstHour = TimeZoneInfo.Local.SupportsDaylightSavingTime && Math.Abs(off - 3600) <= 2;
+ Assert.True(off <= 2 || dstHour, $"time {time} instead of {KnownTime}");
}
[Fact]