File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed
Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,6 @@ void remove(const fs::path& path) noexcept {
5959 try {
6060 std::error_code ec;
6161 fs::remove_all (path, ec);
62-
63- fs::path parent = path.parent_path ();
64- if (!fs::equivalent (parent, fs::temp_directory_path (), ec)) {
65- fs::remove (parent, ec);
66- }
6762 } catch (const std::bad_alloc& ex) {
6863 static_cast <void >(ex);
6964 }
Original file line number Diff line number Diff line change 55
66#include < filesystem>
77#include < fstream>
8- #include < gmock/gmock.h>
98#include < iterator>
109#include < stdexcept>
1110#include < utility>
@@ -23,7 +22,9 @@ TEST(directory, create_with_prefix) {
2322 EXPECT_TRUE (fs::exists (tmpdir));
2423 EXPECT_TRUE (fs::is_directory (tmpdir));
2524 EXPECT_TRUE (fs::equivalent (parent, fs::temp_directory_path ()));
26- EXPECT_THAT (tmpdir.path ().filename (), testing::StartsWith (PREFIX));
25+
26+ fs::path::string_type filename = tmpdir.path ().filename ();
27+ EXPECT_EQ (filename.substr (0 , std::string (PREFIX).length ()), fs::path (PREFIX));
2728
2829 fs::perms permissions = fs::status (tmpdir).permissions ();
2930#ifdef _WIN32
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ unit_test = executable(
66 ' file.cpp' ,
77 dependencies : [gtest_main_dep, tmp_dep],
88 cpp_args : [
9- ' -DLABEL ="com.github.bugdea1er.tmp"' ,
9+ ' -DPREFIX ="com.github.bugdea1er.tmp"' ,
1010 ' -DBUILD_DIR="' + meson .current_build_dir() + ' "' ,
1111 ],
1212 build_by_default : false ,
You can’t perform that action at this time.
0 commit comments