From 3271984e52c7e15d79f4630227e57dd4eaa3bae6 Mon Sep 17 00:00:00 2001 From: Bernhard Seckinger Date: Wed, 13 Nov 2019 08:08:13 +0100 Subject: [PATCH] Fix partially Issue 11809 - unit tests leave behind temporary files --- std/stdio.d | 1 + 1 file changed, 1 insertion(+) diff --git a/std/stdio.d b/std/stdio.d index 3897bbb13..64b00f232 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -2318,6 +2318,7 @@ the contents may well have changed). static import std.file; auto deleteme = testFilename(); std.file.write(deleteme, "Line 1\nLine 2\nLine 3\n"); + scope(success) std.file.remove(deleteme); auto f = File(deleteme); f.byLine();