]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/regex/test/regress/test_icu.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / regex / test / regress / test_icu.cpp
index 6e21cf3783e46aa567971780a60871c45d5ced14..67044f0e09ea8fd4af7d487c19c826976018338d 100644 (file)
@@ -96,6 +96,40 @@ void compare_result(const MR1& w1, const MR2& w2, boost::mpl::int_<2> const*)
          BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32);
       }
    }
+   //
+   // We don't have a way to access a list of named sub-expressions since we only store
+   // hashes, but "abc" and "N" are common names used in our tests, so check those:
+   //
+   if (w1["abc"].matched)
+   {
+      if (w2["abc"].matched == 0)
+      {
+         BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32);
+      }
+      if ((w1.position("abc") != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2.prefix().first), iterator_type(w2["abc"].first))) || (w1.length("abc") != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2["abc"].first), iterator_type(w2["abc"].second))))
+      {
+         BOOST_REGEX_TEST_ERROR("Iterator mismatch in match_results class", UChar32);
+      }
+   }
+   else if (w2["abc"].matched)
+   {
+      BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32);
+   }
+   if (w1["N"].matched)
+   {
+      if (w2["N"].matched == 0)
+      {
+         BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32);
+      }
+      if ((w1.position("N") != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2.prefix().first), iterator_type(w2["N"].first))) || (w1.length("N") != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2["N"].first), iterator_type(w2["N"].second))))
+      {
+         BOOST_REGEX_TEST_ERROR("Iterator mismatch in match_results class", UChar32);
+      }
+   }
+   else if (w2["N"].matched)
+   {
+      BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32);
+   }
 }
 template <class MR1, class MR2>
 void compare_result(const MR1& w1, const MR2& w2, boost::mpl::int_<1> const*)