diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/rope_test/crope.pred.test.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/rope_test/crope.pred.test.cpp b/test/rope_test/crope.pred.test.cpp index afbc9c5..a967adb 100644 --- a/test/rope_test/crope.pred.test.cpp +++ b/test/rope_test/crope.pred.test.cpp @@ -7,6 +7,7 @@ #include <ocl/tproc/rope.hpp> #include <memory> +#include <iostream> #define BOOST_TEST_MODULE crope_pred #include <boost/test/included/unit_test.hpp> @@ -20,11 +21,11 @@ using namespace boost; BOOST_AUTO_TEST_CASE(rope_should_succeed_in_find_pred) { auto rope = tproc::crope("Exact Sentence"); - auto it = tproc::rope::exact_pred<tproc::crope>{"Exact Sentence"}(rope.cbegin(), rope.cend()); + auto it = tproc::rope::exact_pred<tproc::crope>{"Exact Sentence"}(rope.begin(), rope.end()); BOOST_TEST(it != rope.cend()); - ocl::io::println(it->data()); + std::cout << rope << std::endl; } BOOST_AUTO_TEST_CASE(rope_should_succeed_in_at) @@ -32,27 +33,26 @@ BOOST_AUTO_TEST_CASE(rope_should_succeed_in_at) auto rope = tproc::crope("Exact Sentence"); auto it = std::move(rope.substr(rope.at("Exact"), rope.size())); - ocl::io::println(it.data()); + BOOST_ASSERT(it == "Exact Sentence"); } BOOST_AUTO_TEST_CASE(rope_should_succeed_in_starts_with) { auto rope = tproc::crope("The Quick Brown Fox Jumps Over The Lazy Dog"); - + // find the leaf with the starting value 'foo' - auto it = tproc::rope::starts_with_pred<tproc::crope>{"The Quick"}(rope.cbegin(), rope.cend()); + auto it = tproc::rope::starts_with_pred<tproc::crope>{"The Quick"}(rope.begin(), rope.end()); BOOST_TEST(it != rope.cend()); - auto it_end = tproc::rope::ends_with_pred<tproc::crope>{"Lazy Dog"}(rope.cbegin(), rope.cend()); + auto it_end = tproc::rope::ends_with_pred<tproc::crope>{"Lazy Dog"}(rope.begin(), rope.end()); BOOST_TEST(it_end != rope.cend()); - io::println(it_end->data()); - io::println(it->data()); - - std::unique_ptr<tproc::crope> new_elem(new tproc::crope(", and Jumps again.")); + std::unique_ptr<tproc::crope> new_elem = std::make_unique<tproc::crope>(", and Jumps again."); std::unique_ptr<tproc::crope> ret_elem(rope.concat(new_elem.get())); - io::println(ret_elem->data()); + BOOST_TEST((*ret_elem == "The Quick Brown Fox Jumps Over The Lazy Dog, and Jumps again.")); + + std::cout << *ret_elem; } |
