10 #include <boost/test/unit_test.hpp>
20 std::string u8_str =
"fs_tests_₿_🏃";
32 std::string invalid_u8_str =
"\xf0";
40 std::string test_filename =
"fs_tests_₿_🏃.dat";
41 std::string expected_stem =
"fs_tests_₿_🏃";
47 fs::path tmpfolder = m_args.GetDataDirBase();
52 std::ofstream file{tmpfile1};
56 std::ifstream file{tmpfile2};
57 std::string input_buffer;
62 std::ifstream file{tmpfile1, std::ios_base::in | std::ios_base::ate};
63 std::string input_buffer;
68 std::ofstream file{tmpfile2, std::ios_base::out | std::ios_base::app};
72 std::ifstream file{tmpfile1};
73 std::string input_buffer;
78 std::ofstream file{tmpfile2, std::ios_base::out | std::ios_base::trunc};
82 std::ifstream file{tmpfile1};
83 std::string input_buffer;
123 const fs::path tmpfolder{m_args.GetDataDirBase()};
128 const std::string path1_contents{
"1111"};
129 const std::string path2_contents{
"2222"};
132 std::ofstream file{path1};
133 file << path1_contents;
137 std::ofstream file{path2};
138 file << path2_contents;
147 std::ifstream file{path2};
148 std::string contents;
159 const fs::path tmpfolder{m_args.GetDataDirBase()};
162 fs::create_directory(dir);
168 fs::create_directory_symlink(dir, symlink);
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(fsbridge_pathtostring)
fs::path GetUniquePath(const fs::path &base)
Helper function for getting a unique path.
static path u8path(const std::string &utf8_str)
static bool create_directories(const std::filesystem::path &p)
Create directory (and if necessary its parents), unless the leaf directory already exists or is a sym...
static bool exists(const path &p)
static std::string PathToString(const path &path)
Convert path object to a byte string.
static path PathFromString(const std::string &string)
Convert byte string to path object.
fs::path AbsPathJoin(const fs::path &base, const fs::path &path)
Helper function for joining two paths.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
bool RenameOver(fs::path src, fs::path dest)
Rename src to dest.