aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/basicfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenutil/basicfile.cpp')
-rw-r--r--src/zenutil/basicfile.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/zenutil/basicfile.cpp b/src/zenutil/basicfile.cpp
index 575d153b2..73f27b587 100644
--- a/src/zenutil/basicfile.cpp
+++ b/src/zenutil/basicfile.cpp
@@ -858,13 +858,16 @@ TEST_CASE("TemporaryFile")
SUBCASE("DeleteOnClose")
{
- TemporaryFile TmpFile;
- std::error_code Ec;
- TmpFile.CreateTemporary(std::filesystem::current_path(), Ec);
- CHECK(!Ec);
- CHECK(std::filesystem::exists(TmpFile.GetPath()));
- TmpFile.Close();
- CHECK(std::filesystem::exists(TmpFile.GetPath()) == false);
+ std::filesystem::path Path;
+ {
+ TemporaryFile TmpFile;
+ std::error_code Ec;
+ TmpFile.CreateTemporary(std::filesystem::current_path(), Ec);
+ CHECK(!Ec);
+ Path = TmpFile.GetPath();
+ CHECK(std::filesystem::exists(Path));
+ }
+ CHECK(std::filesystem::exists(Path) == false);
}
SUBCASE("MoveIntoPlace")