diff options
Diffstat (limited to 'test/rope_test/crope.pred.test.cpp')
| -rw-r--r-- | test/rope_test/crope.pred.test.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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()); +} |
