aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/regex/pcre/pcre_ut.cpp
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/regex/pcre/pcre_ut.cpp
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/regex/pcre/pcre_ut.cpp')
-rw-r--r--library/cpp/regex/pcre/pcre_ut.cpp89
1 files changed, 89 insertions, 0 deletions
diff --git a/library/cpp/regex/pcre/pcre_ut.cpp b/library/cpp/regex/pcre/pcre_ut.cpp
new file mode 100644
index 0000000000..84d06499ae
--- /dev/null
+++ b/library/cpp/regex/pcre/pcre_ut.cpp
@@ -0,0 +1,89 @@
+#include <library/cpp/regex/pcre/pcre.h>
+
+#include <library/cpp/testing/unittest/registar.h>
+
+template <class T>
+inline IOutputStream& operator<<(IOutputStream& out, const TVector<T>& value) {
+ size_t size = value.size();
+ out << "[";
+ for (size_t i = 0; i < size; ++i) {
+ if (i) {
+ out << ",";
+ }
+ out << value[i];
+ }
+ out << "]";
+ return out;
+}
+
+template <class T, class U>
+inline IOutputStream& operator<<(IOutputStream& out, const std::pair<T, U>& value) {
+ out << "{" << value.first << "," << value.second << "}";
+ return out;
+}
+
+// char8_t
+#define OPTIMIZE NPcre::EOptimize::None
+#define TEST_NAME(S) S
+#define STRING(S) S
+#define CHAR_TYPE char
+#include "pcre_ut_base.h"
+
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::Study
+#undef TEST_NAME
+#define TEST_NAME(S) S ## Study
+#include "pcre_ut_base.h"
+
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::JIT
+#undef TEST_NAME
+#define TEST_NAME(S) S ## JIT
+#include "pcre_ut_base.h"
+
+// char16_t
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::None
+#undef TEST_NAME
+#define TEST_NAME(S) S ## 16
+#undef STRING
+#define STRING(S) u ## S
+#undef CHAR_TYPE
+#define CHAR_TYPE wchar16
+#include "pcre_ut_base.h"
+
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::Study
+#undef TEST_NAME
+#define TEST_NAME(S) S ## Study16
+#include "pcre_ut_base.h"
+
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::JIT
+#undef TEST_NAME
+#define TEST_NAME(S) S ## JIT16
+#include "pcre_ut_base.h"
+
+// char32_t
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::None
+#undef TEST_NAME
+#define TEST_NAME(S) S ## 32
+#undef STRING
+#define STRING(S) U ## S
+#undef CHAR_TYPE
+#define CHAR_TYPE wchar32
+#include "pcre_ut_base.h"
+
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::Study
+#undef TEST_NAME
+#define TEST_NAME(S) S ## Study32
+#include "pcre_ut_base.h"
+
+#undef OPTIMIZE
+#define OPTIMIZE NPcre::EOptimize::JIT
+#undef TEST_NAME
+#define TEST_NAME(S) S ## JIT32
+#include "pcre_ut_base.h"
+