Trying to fix file utils unit test on Windows - cannot remove file when still open?

This commit is contained in:
Matthias Koefferlein 2023-11-01 21:16:18 +01:00
parent 2d2b0f34b3
commit a6a958838d
1 changed files with 8 additions and 4 deletions

View File

@ -886,8 +886,10 @@ TEST (21)
os << "A test";
os.close ();
tl::InputStream is (p);
EXPECT_EQ (is.read_all (), "A test");
{
tl::InputStream is (p);
EXPECT_EQ (is.read_all (), "A test");
}
EXPECT_EQ (tl::rm_file (p), true);
EXPECT_EQ (tl::file_exists (p), false);
@ -925,8 +927,10 @@ TEST (23)
os << "A test";
os.close ();
tl::InputStream is (tl::combine_path (p, "test"));
EXPECT_EQ (is.read_all (), "A test");
{
tl::InputStream is (tl::combine_path (p, "test"));
EXPECT_EQ (is.read_all (), "A test");
}
EXPECT_EQ (tl::rm_dir_recursive (p), true);
EXPECT_EQ (tl::file_exists (p), false);