| 16 | BOOST_FIXTURE_TEST_SUITE(fs_tests, BasicTestingSetup) |
| 17 | |
| 18 | BOOST_AUTO_TEST_CASE(fsbridge_pathtostring) |
| 19 | { |
| 20 | std::string u8_str = "fs_tests_₿_🏃"; |
| 21 | BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(u8_str)), u8_str); |
| 22 | BOOST_CHECK_EQUAL(fs::u8path(u8_str).u8string(), u8_str); |
| 23 | BOOST_CHECK_EQUAL(fs::PathFromString(u8_str).u8string(), u8_str); |
| 24 | BOOST_CHECK_EQUAL(fs::PathToString(fs::u8path(u8_str)), u8_str); |
| 25 | #ifndef WIN32 |
| 26 | // On non-windows systems, verify that arbitrary byte strings containing |
| 27 | // invalid UTF-8 can be round tripped successfully with PathToString and |
| 28 | // PathFromString. On non-windows systems, paths are just byte strings so |
| 29 | // these functions do not do any encoding. On windows, paths are Unicode, |
| 30 | // and these functions do encoding and decoding, so the behavior of this |
| 31 | // test would be undefined. |
| 32 | std::string invalid_u8_str = "\xf0"; |
| 33 | BOOST_CHECK_EQUAL(invalid_u8_str.size(), 1); |
| 34 | BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(invalid_u8_str)), invalid_u8_str); |
| 35 | #endif |
| 36 | } |
| 37 | |
| 38 | BOOST_AUTO_TEST_CASE(fsbridge_stem) |
| 39 | { |
nothing calls this directly
no test coverage detected