diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-12-09 13:22:59 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-12-11 17:42:05 +0100 |
commit | fa00098e1a493aa3cce20335d18e7f5f2fb7a4a8 (patch) | |
tree | 6eef26a95aecb3466c8577d9fc2a599d282d48cf /src/test | |
parent | fa2bac08c22182e738a8cabf1b24a9dbf3b092d2 (diff) |
Add tests for C++20 std::u8string
Also, add missing includes:
#include <system_error> // for error_code
#include <type_traits> // for is_same
#include <cerrno> // for errno
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fs_tests.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/fs_tests.cpp b/src/test/fs_tests.cpp index 7cfecb2b22..f6fab7f733 100644 --- a/src/test/fs_tests.cpp +++ b/src/test/fs_tests.cpp @@ -18,8 +18,10 @@ BOOST_FIXTURE_TEST_SUITE(fs_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(fsbridge_pathtostring) { std::string u8_str = "fs_tests_₿_🏃"; + std::u8string str8{u8"fs_tests_₿_🏃"}; BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(u8_str)), u8_str); BOOST_CHECK_EQUAL(fs::u8path(u8_str).u8string(), u8_str); + BOOST_CHECK_EQUAL(fs::path(str8).u8string(), u8_str); BOOST_CHECK_EQUAL(fs::PathFromString(u8_str).u8string(), u8_str); BOOST_CHECK_EQUAL(fs::PathToString(fs::u8path(u8_str)), u8_str); #ifndef WIN32 @@ -47,7 +49,7 @@ BOOST_AUTO_TEST_CASE(fsbridge_fstream) fs::path tmpfolder = m_args.GetDataDirBase(); // tmpfile1 should be the same as tmpfile2 fs::path tmpfile1 = tmpfolder / fs::u8path("fs_tests_₿_🏃"); - fs::path tmpfile2 = tmpfolder / fs::u8path("fs_tests_₿_🏃"); + fs::path tmpfile2 = tmpfolder / fs::path(u8"fs_tests_₿_🏃"); { std::ofstream file{tmpfile1}; file << "bitcoin"; |