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

Function test_reverse_iterators

test/path_unit_test.cpp:724–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722// test_reverse_iterators ----------------------------------------------------------//
723
724void test_reverse_iterators()
725{
726 std::cout << "testing reverse_iterators..." << std::endl;
727
728 path p1;
729 CHECK(p1.rbegin() == p1.rend());
730
731 path p2("/");
732 CHECK(p2.rbegin() != p2.rend());
733 CHECK(*p2.rbegin() == "/");
734 CHECK(++p2.rbegin() == p2.rend());
735
736 path p3("foo/bar/baz");
737
738 path::reverse_iterator it(p3.rbegin());
739 CHECK(p3.rbegin() != p3.rend());
740 CHECK(*it == "baz");
741 CHECK(*++it == "bar");
742 CHECK(*++it == "foo");
743 CHECK(*--it == "bar");
744 CHECK(*--it == "baz");
745 CHECK(*++it == "bar");
746 CHECK(*++it == "foo");
747 CHECK(++it == p3.rend());
748}
749
750// test_modifiers ------------------------------------------------------------------//
751

Callers 1

test_mainFunction · 0.85

Calls 2

rbeginMethod · 0.80
rendMethod · 0.80

Tested by

no test coverage detected