diff options
| author | galtsev <[email protected]> | 2022-02-10 16:49:32 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:32 +0300 | 
| commit | b3770c4662dc5be7135e21630d44f69d0787c167 (patch) | |
| tree | e8fca9ae46f702aa7e1d2a7fdb3d4e969ae2aff7 /library/cpp/regex | |
| parent | d6a9908bd3435a3571dfcb969988eba7a690802b (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/regex')
| -rw-r--r-- | library/cpp/regex/hyperscan/hyperscan.h | 4 | ||||
| -rw-r--r-- | library/cpp/regex/pire/ut/regexp_ut.cpp | 110 | ||||
| -rw-r--r-- | library/cpp/regex/pire/ut/ya.make | 2 | ||||
| -rw-r--r-- | library/cpp/regex/pire/ya.make | 4 | 
4 files changed, 60 insertions, 60 deletions
diff --git a/library/cpp/regex/hyperscan/hyperscan.h b/library/cpp/regex/hyperscan/hyperscan.h index 1c8f4043892..f116d683d8d 100644 --- a/library/cpp/regex/hyperscan/hyperscan.h +++ b/library/cpp/regex/hyperscan/hyperscan.h @@ -123,8 +123,8 @@ namespace NHyperscan {      TDatabase CompileMulti(          const TVector<const char*>& regexs,          const TVector<unsigned int>& flags, -        const TVector<unsigned int>& ids, -        const TVector<const hs_expr_ext_t*>* extendedParameters = nullptr); +        const TVector<unsigned int>& ids,  +        const TVector<const hs_expr_ext_t*>* extendedParameters = nullptr);       TDatabase CompileMulti(          const TVector<const char*>& regexs, diff --git a/library/cpp/regex/pire/ut/regexp_ut.cpp b/library/cpp/regex/pire/ut/regexp_ut.cpp index e7206de9ad4..90fdcc4a2ca 100644 --- a/library/cpp/regex/pire/ut/regexp_ut.cpp +++ b/library/cpp/regex/pire/ut/regexp_ut.cpp @@ -156,66 +156,66 @@ Y_UNIT_TEST_SUITE(TRegExp) {          //UNIT_ASSERT_VALUES_EQUAL(searcher.GetCaptured(), TStringBuf("pref bla suff"));      } -    Y_UNIT_TEST(CaptureXA) { -        TCapturingFsm fsm(".*(xa).*"); - -        TSearcher searcher(fsm); -        searcher.Search("xa"); -        UNIT_ASSERT(searcher.Captured()); +    Y_UNIT_TEST(CaptureXA) {  +        TCapturingFsm fsm(".*(xa).*");  +  +        TSearcher searcher(fsm);  +        searcher.Search("xa");  +        UNIT_ASSERT(searcher.Captured());           UNIT_ASSERT_VALUES_EQUAL(searcher.GetCaptured(), TStringBuf("xa")); -    } - -    Y_UNIT_TEST(CaptureWrongXX) { -        TCapturingFsm fsm(".*(xx).*"); - -        TSearcher searcher(fsm); -        searcher.Search("xx"); -        UNIT_ASSERT(searcher.Captured()); -        // Surprise! -        // TCapturingFsm uses a fast - O(|text|) - but incorrect algorithm. -        // It works more or less for a particular class of regexps to which ".*(xx).*" does not belong. -        // So it returns not the expected "xx" but just the second "x" instead. +    }  +  +    Y_UNIT_TEST(CaptureWrongXX) {  +        TCapturingFsm fsm(".*(xx).*");  +  +        TSearcher searcher(fsm);  +        searcher.Search("xx");  +        UNIT_ASSERT(searcher.Captured());  +        // Surprise!  +        // TCapturingFsm uses a fast - O(|text|) - but incorrect algorithm.  +        // It works more or less for a particular class of regexps to which ".*(xx).*" does not belong.  +        // So it returns not the expected "xx" but just the second "x" instead.           UNIT_ASSERT_VALUES_EQUAL(searcher.GetCaptured(), TStringBuf("x")); -    } - -    Y_UNIT_TEST(CaptureRight1XX) { -        TCapturingFsm fsm("[^x]+(xx).*"); - -        TSearcher searcher(fsm); - -        searcher.Search("xxx"); -        UNIT_ASSERT(!searcher.Captured()); -    } - -    Y_UNIT_TEST(CaptureRight2XX) { -        TCapturingFsm fsm("[^x]+(xx).*"); - -        TSearcher searcher(fsm); - -        searcher.Search("axx"); -        UNIT_ASSERT(searcher.Captured()); +    }  +  +    Y_UNIT_TEST(CaptureRight1XX) {  +        TCapturingFsm fsm("[^x]+(xx).*");  +  +        TSearcher searcher(fsm);  +  +        searcher.Search("xxx");  +        UNIT_ASSERT(!searcher.Captured());  +    }  +  +    Y_UNIT_TEST(CaptureRight2XX) {  +        TCapturingFsm fsm("[^x]+(xx).*");  +  +        TSearcher searcher(fsm);  +  +        searcher.Search("axx");  +        UNIT_ASSERT(searcher.Captured());           UNIT_ASSERT_VALUES_EQUAL(searcher.GetCaptured(), TStringBuf("xx")); -    } - -    Y_UNIT_TEST(CaptureRight3XX) { -        TCapturingFsm fsm("[^x]+(xx).*"); - -        TSearcher searcher(fsm); - -        searcher.Search("axxb"); -        UNIT_ASSERT(searcher.Captured()); +    }  +  +    Y_UNIT_TEST(CaptureRight3XX) {  +        TCapturingFsm fsm("[^x]+(xx).*");  +  +        TSearcher searcher(fsm);  +  +        searcher.Search("axxb");  +        UNIT_ASSERT(searcher.Captured());           UNIT_ASSERT_VALUES_EQUAL(searcher.GetCaptured(), TStringBuf("xx")); -    } - -    Y_UNIT_TEST(SlowCaptureXX) { -        TSlowCapturingFsm fsm(".*(xx).*"); - -        TSlowSearcher searcher(fsm); -        searcher.Search("xx"); -        UNIT_ASSERT(searcher.Captured()); +    }  +  +    Y_UNIT_TEST(SlowCaptureXX) {  +        TSlowCapturingFsm fsm(".*(xx).*");  +  +        TSlowSearcher searcher(fsm);  +        searcher.Search("xx");  +        UNIT_ASSERT(searcher.Captured());           UNIT_ASSERT_VALUES_EQUAL(searcher.GetCaptured(), TStringBuf("xx")); -    } - +    }  +       Y_UNIT_TEST(SlowCapture) {          TSlowCapturingFsm fsm("^http://vk(ontakte[.]ru|[.]com)/id(\\d+)([^0-9]|$)",                                TFsm::TOptions().SetCapture(2)); diff --git a/library/cpp/regex/pire/ut/ya.make b/library/cpp/regex/pire/ut/ya.make index 8776695f405..212901e911e 100644 --- a/library/cpp/regex/pire/ut/ya.make +++ b/library/cpp/regex/pire/ut/ya.make @@ -28,7 +28,7 @@ SRCS(      pire_ut.cpp      capture_ut.cpp      count_ut.cpp -    glyph_ut.cpp +    glyph_ut.cpp       easy_ut.cpp      read_unicode_ut.cpp      regexp_ut.cpp diff --git a/library/cpp/regex/pire/ya.make b/library/cpp/regex/pire/ya.make index c857e6d18bc..50857fc11d9 100644 --- a/library/cpp/regex/pire/ya.make +++ b/library/cpp/regex/pire/ya.make @@ -36,5 +36,5 @@ PEERDIR(  )  END() - -RECURSE_FOR_TESTS(ut) +  +RECURSE_FOR_TESTS(ut)   | 
