pcre_ut.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #include <library/cpp/regex/pcre/pcre.h>
  2. #include <library/cpp/testing/unittest/registar.h>
  3. template <class T>
  4. inline IOutputStream& operator<<(IOutputStream& out, const TVector<T>& value) {
  5. size_t size = value.size();
  6. out << "[";
  7. for (size_t i = 0; i < size; ++i) {
  8. if (i) {
  9. out << ",";
  10. }
  11. out << value[i];
  12. }
  13. out << "]";
  14. return out;
  15. }
  16. template <class T, class U>
  17. inline IOutputStream& operator<<(IOutputStream& out, const std::pair<T, U>& value) {
  18. out << "{" << value.first << "," << value.second << "}";
  19. return out;
  20. }
  21. // char8_t
  22. #define OPTIMIZE NPcre::EOptimize::None
  23. #define TEST_NAME(S) S
  24. #define STRING(S) S
  25. #define CHAR_TYPE char
  26. #include "pcre_ut_base.h"
  27. #undef OPTIMIZE
  28. #define OPTIMIZE NPcre::EOptimize::Study
  29. #undef TEST_NAME
  30. #define TEST_NAME(S) S ## Study
  31. #include "pcre_ut_base.h"
  32. #undef OPTIMIZE
  33. #define OPTIMIZE NPcre::EOptimize::JIT
  34. #undef TEST_NAME
  35. #define TEST_NAME(S) S ## JIT
  36. #include "pcre_ut_base.h"
  37. // char16_t
  38. #undef OPTIMIZE
  39. #define OPTIMIZE NPcre::EOptimize::None
  40. #undef TEST_NAME
  41. #define TEST_NAME(S) S ## 16
  42. #undef STRING
  43. #define STRING(S) u ## S
  44. #undef CHAR_TYPE
  45. #define CHAR_TYPE wchar16
  46. #include "pcre_ut_base.h"
  47. #undef OPTIMIZE
  48. #define OPTIMIZE NPcre::EOptimize::Study
  49. #undef TEST_NAME
  50. #define TEST_NAME(S) S ## Study16
  51. #include "pcre_ut_base.h"
  52. #undef OPTIMIZE
  53. #define OPTIMIZE NPcre::EOptimize::JIT
  54. #undef TEST_NAME
  55. #define TEST_NAME(S) S ## JIT16
  56. #include "pcre_ut_base.h"
  57. // char32_t
  58. #undef OPTIMIZE
  59. #define OPTIMIZE NPcre::EOptimize::None
  60. #undef TEST_NAME
  61. #define TEST_NAME(S) S ## 32
  62. #undef STRING
  63. #define STRING(S) U ## S
  64. #undef CHAR_TYPE
  65. #define CHAR_TYPE wchar32
  66. #include "pcre_ut_base.h"
  67. #undef OPTIMIZE
  68. #define OPTIMIZE NPcre::EOptimize::Study
  69. #undef TEST_NAME
  70. #define TEST_NAME(S) S ## Study32
  71. #include "pcre_ut_base.h"
  72. #undef OPTIMIZE
  73. #define OPTIMIZE NPcre::EOptimize::JIT
  74. #undef TEST_NAME
  75. #define TEST_NAME(S) S ## JIT32
  76. #include "pcre_ut_base.h"