From d85a56e43f4222115b67e5f6ebf8e4e502ef3da5 Mon Sep 17 00:00:00 2001 From: Dominion Date: Mon, 10 Apr 2023 12:44:41 -0400 Subject: [PATCH] Slight improvement to directory deletion test --- tests/Tgstation.Server.Host.Tests/IO/TestIOManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Tgstation.Server.Host.Tests/IO/TestIOManager.cs b/tests/Tgstation.Server.Host.Tests/IO/TestIOManager.cs index 942643b2c2..d18400d728 100644 --- a/tests/Tgstation.Server.Host.Tests/IO/TestIOManager.cs +++ b/tests/Tgstation.Server.Host.Tests/IO/TestIOManager.cs @@ -20,13 +20,17 @@ namespace Tgstation.Server.Host.IO.Tests Directory.CreateDirectory(tempPath); try { + await File.WriteAllTextAsync(Path.Combine(tempPath, "file.txt"), "asdf"); + var subDir = Path.Combine(tempPath, "subdir"); + Directory.CreateDirectory(subDir); + await File.WriteAllTextAsync(Path.Combine(subDir, "file2.txt"), "fdsa"); await ioManager.DeleteDirectory(tempPath, default); Assert.IsFalse(Directory.Exists(tempPath)); } catch { - Directory.Delete(tempPath); + Directory.Delete(tempPath, true); throw; } }