Skip to content

Commit 6b28814

Browse files
committed
Added deletion of generated text file to example tests.
1 parent e79df4b commit 6b28814

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

example_and_tests/example/tests/file_writer_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <filesystem>
2+
13
#include <gtest/gtest.h>
24

35
#include "example_and_tests/example/file_writer.hpp"
@@ -16,6 +18,7 @@ TEST_F(FileWriterTest, ExecuteTest) {
1618
test_file_writer.Execute(filename_ + ".txt");
1719

1820
EXPECT_GOLD_FILE_MATCH(filename_ + ".txt", "test_data/" + filename_ + ".gold");
21+
EXPECT_TRUE(std::filesystem::remove(filename_ + ".txt")) << "Generated file not found for deletion.";
1922
}
2023

2124
} // namespace

0 commit comments

Comments
 (0)