summaryrefslogtreecommitdiffhomepage
path: root/test/rope_test/crope.pred.test.cpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-12 06:08:33 +0100
committerGitHub <noreply@github.com>2026-03-12 06:08:33 +0100
commitdeca9f5be38700763023d565558c0e3c4799b2e2 (patch)
tree4ee734390f1854c0cdf7fa3c298ebfd8c4f75325 /test/rope_test/crope.pred.test.cpp
parentf88fe31af6b19a972c2b72d9fdaee8c1985cfd9f (diff)
parentab306b056d33874ddf16020e16a59ab5f34043cb (diff)
Merge pull request #6 from ocl-foss-org/more-unit-tests
More unit tests
Diffstat (limited to 'test/rope_test/crope.pred.test.cpp')
-rw-r--r--test/rope_test/crope.pred.test.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/test/rope_test/crope.pred.test.cpp b/test/rope_test/crope.pred.test.cpp
index 58424cc..5505462 100644
--- a/test/rope_test/crope.pred.test.cpp
+++ b/test/rope_test/crope.pred.test.cpp
@@ -24,34 +24,22 @@ BOOST_AUTO_TEST_CASE(rope_should_succeed_in_find_pred)
BOOST_TEST(it != rope.cend());
- std::cout << rope << std::endl;
+ std::cout << "Result: " << rope << std::endl;
}
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()));
-
- BOOST_ASSERT(it == "Exact Sentence");
+ BOOST_ASSERT(rope.to_string() == "Exact Sentence");
}
-BOOST_AUTO_TEST_CASE(rope_should_succeed_in_starts_with)
+BOOST_AUTO_TEST_CASE(rope_should_succeed_in_concat)
{
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.begin(), rope.end());
-
- BOOST_TEST(it != rope.cend());
-
- auto it_end = tproc::rope::ends_with_pred<tproc::crope>{"Lazy Dog"}(rope.begin(), rope.end());
-
- BOOST_TEST(it_end != rope.cend());
-
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()));
-
- BOOST_TEST((*ret_elem == "The Quick Brown Fox Jumps Over The Lazy Dog, and Jumps again."));
+ rope.concat(new_elem.get());
- std::cout << *ret_elem;
+ BOOST_TEST((rope.to_string() == "The Quick Brown Fox Jumps Over The Lazy Dog, and Jumps again."));
+ BOOST_TEST((new_elem->to_string() == ", and Jumps again."));
+ std::cout << "Result: " << rope << std::endl;
}