diff options
| author | Alexander Gololobov <[email protected]> | 2022-02-10 16:47:38 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:38 +0300 | 
| commit | fccc62e9bfdce9be2fe7e0f23479da3a5512211a (patch) | |
| tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /library/cpp/regex/pire/ut | |
| parent | 39608cdb86363c75ce55b2b9a69841c3b71f22cf (diff) | |
Restoring authorship annotation for Alexander Gololobov <[email protected]>. Commit 2 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 7c517bc583b..e7206de9ad4 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 d0a23018160..8776695f405 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()  | 
