diff options
author | Alexander Gololobov <davenger@yandex-team.com> | 2022-02-10 16:47:37 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:37 +0300 |
commit | 39608cdb86363c75ce55b2b9a69841c3b71f22cf (patch) | |
tree | 4ec132c1665bd4d68e3628aa18d937c70d32413b /library/cpp/regex/pire/ut | |
parent | 54295b9bd4dc45c54d804084fd846d945148a7f0 (diff) | |
download | ydb-39608cdb86363c75ce55b2b9a69841c3b71f22cf.tar.gz |
Restoring authorship annotation for Alexander Gololobov <davenger@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/regex/pire/ut')
-rw-r--r-- | library/cpp/regex/pire/ut/regexp_ut.cpp | 50 | ||||
-rw-r--r-- | library/cpp/regex/pire/ut/ya.make | 28 |
2 files changed, 39 insertions, 39 deletions
diff --git a/library/cpp/regex/pire/ut/regexp_ut.cpp b/library/cpp/regex/pire/ut/regexp_ut.cpp index e7206de9ad..7c517bc583 100644 --- a/library/cpp/regex/pire/ut/regexp_ut.cpp +++ b/library/cpp/regex/pire/ut/regexp_ut.cpp @@ -17,41 +17,41 @@ Y_UNIT_TEST_SUITE(TRegExp) { } Y_UNIT_TEST(Boundaries) { - UNIT_ASSERT(!TMatcher(TFsm("qwb$", TFsm::TOptions().SetSurround(true))).Match("aqwb").Final()); - UNIT_ASSERT(!TMatcher(TFsm("^aqw", TFsm::TOptions().SetSurround(true))).Match("aqwb").Final()); + UNIT_ASSERT(!TMatcher(TFsm("qwb$", TFsm::TOptions().SetSurround(true))).Match("aqwb").Final()); + UNIT_ASSERT(!TMatcher(TFsm("^aqw", TFsm::TOptions().SetSurround(true))).Match("aqwb").Final()); UNIT_ASSERT(TMatcher(TFsm("qwb$", TFsm::TOptions().SetSurround(true))).Match(TStringBuf("aqwb"), true, true).Final()); UNIT_ASSERT(TMatcher(TFsm("^aqw", TFsm::TOptions().SetSurround(true))).Match(TStringBuf("aqwb"), true, true).Final()); UNIT_ASSERT(!TMatcher(TFsm("qw$", TFsm::TOptions().SetSurround(true))).Match(TStringBuf("aqwb"), true, true).Final()); UNIT_ASSERT(!TMatcher(TFsm("^qw", TFsm::TOptions().SetSurround(true))).Match(TStringBuf("aqwb"), true, true).Final()); - - UNIT_ASSERT(TMatcher(TFsm("^aqwb$", TFsm::TOptions().SetSurround(true))) + + UNIT_ASSERT(TMatcher(TFsm("^aqwb$", TFsm::TOptions().SetSurround(true))) .Match(TStringBuf("a"), true, false) .Match(TStringBuf("q"), false, false) .Match(TStringBuf("w"), false, false) .Match(TStringBuf("b"), false, true) .Final()); - } - + } + Y_UNIT_TEST(Case) { UNIT_ASSERT(TMatcher(TFsm("qw", TFsm::TOptions().SetCaseInsensitive(true))).Match("Qw").Final()); UNIT_ASSERT(!TMatcher(TFsm("qw", TFsm::TOptions().SetCaseInsensitive(false))).Match("Qw").Final()); } - + Y_UNIT_TEST(UnicodeCase) { UNIT_ASSERT(TMatcher(TFsm("\\x{61}\\x{62}", TFsm::TOptions().SetCaseInsensitive(true))).Match("Ab").Final()); UNIT_ASSERT(!TMatcher(TFsm("\\x{61}\\x{62}", TFsm::TOptions().SetCaseInsensitive(false))).Match("Ab").Final()); } Y_UNIT_TEST(Utf) { - NRegExp::TFsmBase::TOptions opts; - opts.Charset = CODES_UTF8; - opts.Surround = true; - UNIT_ASSERT(TMatcher(TFsm(".*", opts)).Match("wtf").Final()); - UNIT_ASSERT(TMatcher(TFsm(".*", opts)).Match("чзн").Final()); - UNIT_ASSERT(TMatcher(TFsm("ч.*", opts)).Match("чзн").Final()); - UNIT_ASSERT(!TMatcher(TFsm("чзн", opts)).Match("чзх").Final()); - } - + NRegExp::TFsmBase::TOptions opts; + opts.Charset = CODES_UTF8; + opts.Surround = true; + UNIT_ASSERT(TMatcher(TFsm(".*", opts)).Match("wtf").Final()); + UNIT_ASSERT(TMatcher(TFsm(".*", opts)).Match("чзн").Final()); + UNIT_ASSERT(TMatcher(TFsm("ч.*", opts)).Match("чзн").Final()); + UNIT_ASSERT(!TMatcher(TFsm("чзн", opts)).Match("чзх").Final()); + } + Y_UNIT_TEST(AndNot) { NRegExp::TFsmBase::TOptions opts; opts.AndNotSupport = true; @@ -84,15 +84,15 @@ Y_UNIT_TEST_SUITE(TRegExp) { } Y_UNIT_TEST(Glue) { - TFsm glued = - TFsm("qw", TFsm::TOptions().SetCaseInsensitive(true)) | - TFsm("qw", TFsm::TOptions().SetCaseInsensitive(false)) | - TFsm("abc", TFsm::TOptions().SetCaseInsensitive(false)); - UNIT_ASSERT(TMatcher(glued).Match("Qw").Final()); - UNIT_ASSERT(TMatcher(glued).Match("Qw").Final()); - UNIT_ASSERT(TMatcher(glued).Match("abc").Final()); - UNIT_ASSERT(!TMatcher(glued).Match("Abc").Final()); - } + TFsm glued = + TFsm("qw", TFsm::TOptions().SetCaseInsensitive(true)) | + TFsm("qw", TFsm::TOptions().SetCaseInsensitive(false)) | + TFsm("abc", TFsm::TOptions().SetCaseInsensitive(false)); + UNIT_ASSERT(TMatcher(glued).Match("Qw").Final()); + UNIT_ASSERT(TMatcher(glued).Match("Qw").Final()); + UNIT_ASSERT(TMatcher(glued).Match("abc").Final()); + UNIT_ASSERT(!TMatcher(glued).Match("Abc").Final()); + } Y_UNIT_TEST(Capture1) { TCapturingFsm fsm("here we have user_id=([a-z0-9]+);"); diff --git a/library/cpp/regex/pire/ut/ya.make b/library/cpp/regex/pire/ut/ya.make index 8776695f40..d0a2301816 100644 --- a/library/cpp/regex/pire/ut/ya.make +++ b/library/cpp/regex/pire/ut/ya.make @@ -1,20 +1,20 @@ # this test in not linked into build tree with ReCURSE and is built by unittest/library UNITTEST() - + OWNER( g:util davenger ) SET(PIRETESTSDIR contrib/libs/pire/ut) - + CFLAGS(-DPIRE_NO_CONFIG) - + PEERDIR( library/cpp/regex/pire ) - + SRCDIR( ${PIRETESTSDIR} ) @@ -23,22 +23,22 @@ ADDINCL( contrib/libs/pire/pire contrib/libs/pire/ut ) - -SRCS( - pire_ut.cpp - capture_ut.cpp - count_ut.cpp + +SRCS( + pire_ut.cpp + capture_ut.cpp + count_ut.cpp glyph_ut.cpp - easy_ut.cpp + easy_ut.cpp read_unicode_ut.cpp - regexp_ut.cpp + regexp_ut.cpp approx_matching_ut.cpp -) - +) + SIZE(MEDIUM) TIMEOUT(600) PIRE_INLINE(inline_ut.cpp) -END() +END() |