mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 13:07:07 +01:00
Fix bad test case
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user