MCPcopy Create free account
hub / github.com/boostorg/filesystem / test_appends

Function test_appends

test/path_unit_test.cpp:283–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281 // test_appends --------------------------------------------------------------------//
282
283 void test_appends()
284 {
285 std::cout << "testing appends..." << std::endl;
286
287# ifdef BOOST_WINDOWS_API
288# define BOOST_FS_FOO L"/foo\\"
289# else // POSIX paths
290# define BOOST_FS_FOO L"/foo/"
291# endif
292
293 x = "/foo";
294 x /= path(""); // empty path
295 PATH_IS(x, L"/foo");
296
297 x = "/foo";
298 x /= path("/"); // slash path
299 PATH_IS(x, L"/foo/");
300
301 x = "/foo";
302 x /= path("/boo"); // slash path
303 PATH_IS(x, L"/foo/boo");
304
305 x = "/foo";
306 x /= x; // self-append
307 PATH_IS(x, L"/foo/foo");
308
309 x = "/foo";
310 x /= path("yet another path"); // another path
311 PATH_IS(x, BOOST_FS_FOO L"yet another path");
312
313 x = "/foo";
314 x.append(l.begin(), l.end()); // iterator range char
315 PATH_IS(x, BOOST_FS_FOO L"string");
316
317 x = "/foo";
318 x.append(wl.begin(), wl.end()); // iterator range wchar_t
319 PATH_IS(x, BOOST_FS_FOO L"wstring");
320
321 x = "/foo";
322 x /= string("std::string"); // container char
323 PATH_IS(x, BOOST_FS_FOO L"std::string");
324
325 x = "/foo";
326 x /= wstring(L"std::wstring"); // container wchar_t
327 PATH_IS(x, BOOST_FS_FOO L"std::wstring");
328
329 x = "/foo";
330 x /= "array char"; // array char
331 PATH_IS(x, BOOST_FS_FOO L"array char");
332
333 x = "/foo";
334 x /= L"array wchar"; // array wchar_t
335 PATH_IS(x, BOOST_FS_FOO L"array wchar");
336
337 x = "/foo";
338 x /= s.c_str(); // const char* null terminated
339 PATH_IS(x, BOOST_FS_FOO L"string");
340

Callers 1

cpp_mainFunction · 0.85

Calls 5

wstringFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
pathFunction · 0.70
stringFunction · 0.70

Tested by

no test coverage detected