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

Function test_iterators

test/path_unit_test.cpp:591–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589 // test_iterators ------------------------------------------------------------------//
590
591 void test_iterators()
592 {
593 std::cout << "testing iterators..." << std::endl;
594
595 path p1;
596 CHECK(p1.begin() == p1.end());
597
598 path p2("/");
599 CHECK(p2.begin() != p2.end());
600 CHECK(*p2.begin() == "/");
601 CHECK(++p2.begin() == p2.end());
602
603 path p3("foo/bar/baz");
604
605 path::iterator it(p3.begin());
606 CHECK(p3.begin() != p3.end());
607 CHECK(*it == "foo");
608 CHECK(*++it == "bar");
609 CHECK(*++it == "baz");
610 CHECK(*--it == "bar");
611 CHECK(*--it == "foo");
612 CHECK(*++it == "bar");
613 CHECK(*++it == "baz");
614 CHECK(++it == p3.end());
615 }
616
617 // test_modifiers ------------------------------------------------------------------//
618

Callers 1

cpp_mainFunction · 0.85

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected