From f639f7ac24354dc34c8d082bc078479c499d90ce Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 26 Oct 2026 09:52:32 -0400 Subject: [PATCH] Strip out MS-CAB extraction test even further This will make it so that exceptions are surfaced directly into the test log and cancel right away. It effectively does the same thing as capturing the error log and redirecting it, but with many less steps. --- SabreTools.Wrappers.Test/MicrosoftCabinetTests.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SabreTools.Wrappers.Test/MicrosoftCabinetTests.cs b/SabreTools.Wrappers.Test/MicrosoftCabinetTests.cs index 0e07e7f4..27366d1d 100644 --- a/SabreTools.Wrappers.Test/MicrosoftCabinetTests.cs +++ b/SabreTools.Wrappers.Test/MicrosoftCabinetTests.cs @@ -68,16 +68,9 @@ namespace SabreTools.Wrappers.Test var cabinet = MicrosoftCabinet.Create(File.ReadAllBytes(path), 0); Assert.NotNull(cabinet); - // Extract catches the exception and only writes it to the console string outputDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - var originalError = Console.Error; - var error = new StringWriter(); - Console.SetError(error); cabinet.Extract(outputDirectory, includeDebug: true); - Console.SetError(originalError); - // Assert.True shows the whole exception, Assert.Empty cuts it off - Assert.True(error.ToString().Length == 0, error.ToString()); Assert.Equal("Hello, ", File.ReadAllText(Path.Combine(outputDirectory, "a.txt"))); Assert.Equal("World!", File.ReadAllText(Path.Combine(outputDirectory, "b.txt"))); Directory.Delete(outputDirectory, recursive: true);