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

Function test_concats

test/path_unit_test.cpp:381–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379// test_concats --------------------------------------------------------------------//
380
381void test_concats()
382{
383 std::cout << "testing concats..." << std::endl;
384
385 x = "/foo";
386 x += path(""); // empty path
387 PATH_IS(x, L"/foo");
388
389 x = "/foo";
390 x += path("/"); // slash path
391 PATH_IS(x, L"/foo/");
392
393 x = "/foo";
394 x += path("boo"); // slash path
395 PATH_IS(x, L"/fooboo");
396
397 x = "foo";
398 x += x; // self-append
399 PATH_IS(x, L"foofoo");
400
401 x = "foo-";
402 x += path("yet another path"); // another path
403 PATH_IS(x, L"foo-yet another path");
404
405 x = "foo-";
406 x.concat(l.begin(), l.end()); // iterator range char
407 PATH_IS(x, L"foo-string");
408
409 x = "foo-";
410 x.concat(wl.begin(), wl.end()); // iterator range wchar_t
411 PATH_IS(x, L"foo-wstring");
412
413 x = "foo-";
414 x += string("std::string"); // container char
415 PATH_IS(x, L"foo-std::string");
416
417 x = "foo-";
418 x += wstring(L"std::wstring"); // container wchar_t
419 PATH_IS(x, L"foo-std::wstring");
420
421 x = "foo-";
422 x += "array char"; // array char
423 PATH_IS(x, L"foo-array char");
424
425 x = "foo-";
426 x += L"array wchar"; // array wchar_t
427 PATH_IS(x, L"foo-array wchar");
428
429 x = "foo-";
430 x += s.c_str(); // const char* null terminated
431 PATH_IS(x, L"foo-string");
432
433 x = "foo-";
434 x += ws.c_str(); // const wchar_t* null terminated
435 PATH_IS(x, L"foo-wstring");
436
437 x = "foo-";
438 x += 'x'; // char

Callers 1

test_mainFunction · 0.85

Calls 6

stringFunction · 0.85
concatMethod · 0.80
pathFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected