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

Function test_iterators

test/path_unit_test.cpp:696–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694// test_iterators ------------------------------------------------------------------//
695
696void test_iterators()
697{
698 std::cout << "testing iterators..." << std::endl;
699
700 path p1;
701 CHECK(p1.begin() == p1.end());
702
703 path p2("/");
704 CHECK(p2.begin() != p2.end());
705 CHECK(*p2.begin() == "/");
706 CHECK(++p2.begin() == p2.end());
707
708 path p3("foo/bar/baz");
709
710 path::iterator it(p3.begin());
711 CHECK(p3.begin() != p3.end());
712 CHECK(*it == "foo");
713 CHECK(*++it == "bar");
714 CHECK(*++it == "baz");
715 CHECK(*--it == "bar");
716 CHECK(*--it == "foo");
717 CHECK(*++it == "bar");
718 CHECK(*++it == "baz");
719 CHECK(++it == p3.end());
720}
721
722// test_reverse_iterators ----------------------------------------------------------//
723

Callers 1

test_mainFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected