summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-12-27 10:10:21 +0100
committerGitHub <noreply@github.com>2025-12-27 10:10:21 +0100
commitd9033363086aba59f67d805f09bad1e74d23acb5 (patch)
tree0f3060bb24565803117f8ebd60b660fa96bc0f51
parentb608fb79a0100a178fe682ff6d0ba96c90f78bff (diff)
feat: updated Jamfile and unit tests.
-rw-r--r--test/rope_test/Jamfile.v22
-rw-r--r--test/rope_test/crope.pred.test.cpp28
-rw-r--r--test/rope_test/crope.test.cpp2
3 files changed, 31 insertions, 1 deletions
diff --git a/test/rope_test/Jamfile.v2 b/test/rope_test/Jamfile.v2
index 85c867f..bcfefa0 100644
--- a/test/rope_test/Jamfile.v2
+++ b/test/rope_test/Jamfile.v2
@@ -9,6 +9,6 @@ project tests
;
exe crope.test.o
- : crope.test.cpp
+ : crope.test.cpp crope.pred.test.cpp
: <cxxstd>20 ;
diff --git a/test/rope_test/crope.pred.test.cpp b/test/rope_test/crope.pred.test.cpp
new file mode 100644
index 0000000..fe82d78
--- /dev/null
+++ b/test/rope_test/crope.pred.test.cpp
@@ -0,0 +1,28 @@
+/*
+ * File: crope.pred.test.cpp
+ * Purpose: Char rope test.
+ * Author: Amlal El Mahrouss (amlal@nekernel.org)
+ * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License.
+ */
+
+#include <ocl/tproc/rope.hpp>
+
+#define BOOST_TEST_MODULE crope_pred
+#include <boost/test/included/unit_test.hpp>
+
+BOOST_AUTO_TEST_CASE(allocator_should_succeed_in_empty_pred)
+{
+ auto rope = ocl::tproc::crope("");
+ auto it = ocl::tproc::find(rope.cbegin(), rope.cend(), ocl::tproc::exact_pred("foo"));
+
+ BOOST_TEST(it == rope.cend());
+}
+
+BOOST_AUTO_TEST_CASE(allocator_should_not_succeed_in_empty_pred)
+{
+ auto rope = ocl::tproc::crope("foobar");
+
+ auto it = ocl::tproc::find(rope.cbegin(), rope.cend(), ocl::tproc::stars_with_pred("foo"));
+
+ BOOST_TEST(it != rope.cend());
+}
diff --git a/test/rope_test/crope.test.cpp b/test/rope_test/crope.test.cpp
index 4565900..9b9b9eb 100644
--- a/test/rope_test/crope.test.cpp
+++ b/test/rope_test/crope.test.cpp
@@ -13,6 +13,7 @@
BOOST_AUTO_TEST_CASE(allocator_should_succeed_in_empty)
{
auto rope = ocl::tproc::crope("");
+
BOOST_TEST(rope.empty() == true);
}
@@ -20,5 +21,6 @@ BOOST_AUTO_TEST_CASE(allocator_should_not_succeed_in_empty)
{
auto rope = ocl::tproc::crope("foobar");
// rope += ".txt";
+
BOOST_TEST(rope.empty() == false);
}