From f72955cbc610317ea8538ff89a673fb9ba70f049 Mon Sep 17 00:00:00 2001 From: Dominion Date: Sun, 9 Oct 2022 10:30:55 -0400 Subject: [PATCH] Fix bad test case --- .../Tgstation.Server.Host.Tests/IO/TestPostWriteHandler.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/Tgstation.Server.Host.Tests/IO/TestPostWriteHandler.cs b/tests/Tgstation.Server.Host.Tests/IO/TestPostWriteHandler.cs index 7a309c4455..e5081ea7f4 100644 --- a/tests/Tgstation.Server.Host.Tests/IO/TestPostWriteHandler.cs +++ b/tests/Tgstation.Server.Host.Tests/IO/TestPostWriteHandler.cs @@ -40,24 +40,22 @@ namespace Tgstation.Server.Host.IO.Tests var tmpFile = Path.GetTempFileName(); try { + Assert.IsFalse(postWriteHandler.NeedsPostWrite(tmpFile)); postWriteHandler.HandleWrite(tmpFile); if (isWindows) return; //you do nothing //ensure it is now executable + Assert.IsTrue(postWriteHandler.NeedsPostWrite(tmpFile)); File.WriteAllBytes(tmpFile, Encoding.UTF8.GetBytes("#!/bin/sh\n")); - Assert.IsFalse(postWriteHandler.NeedsPostWrite(tmpFile)); - using (var process = Process.Start(tmpFile)) { process.WaitForExit(); Assert.AreEqual(0, process.ExitCode); } - Assert.IsTrue(postWriteHandler.NeedsPostWrite(tmpFile)); - //run it again for the code coverage on that part where no changes are made if it's already executable postWriteHandler.HandleWrite(tmpFile); }