aboutsummaryrefslogtreecommitdiff
path: root/re2/testing/re2_test.cc
AgeCommit message (Collapse)Author
2018-10-02Make the fuzzer limit reverse program size and fanout.Paul Wankadia
Change-Id: I4504e7c06a3b973500c80ae7eaeade24d11a0c45 Reviewed-on: https://code-review.googlesource.com/33850 Reviewed-by: Paul Wankadia <junyer@google.com>
2018-02-22Use ASSERT* macros instead of CHECK* macros in tests.Paul Wankadia
Change-Id: I5aecd93129ff700a5332fedd15283083e4df9b93 Reviewed-on: https://code-review.googlesource.com/24030 Reviewed-by: Paul Wankadia <junyer@google.com>
2018-01-30Add a std::nullptr_t ctor overload to RE2::Arg.Richard Hansen
This makes it possible to pass a C++11 nullptr as a capture argument to RE2::FullMatch() and friends. Change-Id: I34bdb1cd6b1e0670a262cebb0d7be8a4cec5c1fc Reviewed-on: https://code-review.googlesource.com/22410 Reviewed-by: Paul Wankadia <junyer@google.com>
2017-04-12Address some clang-tidy gripes.Paul Wankadia
Change-Id: I45b9570954c529feb618c9f7bf83f8f56802d3e0 Reviewed-on: https://code-review.googlesource.com/12250 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-11-01Tidy up null StringPiece construction.Paul Wankadia
Change-Id: I0e819fc553b4bdc77041567c5003fd4be0c417ce Reviewed-on: https://code-review.googlesource.com/9050 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-30MSVC fails the 6700000000081920.1 test now. Sigh.Paul Wankadia
Change-Id: Ic49cb1f3a1720e896b8a25b8db3fd8265c7d7f3c Reviewed-on: https://code-review.googlesource.com/7220 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-22Migrate the RE2 API to size_t.Paul Wankadia
Fixes #107. Change-Id: I2d85bd40988ebcac33edc680a1f3ddccf631fc4c Reviewed-on: https://code-review.googlesource.com/6974 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-18Get rid of simple uses of snprintf(3).Paul Wankadia
Change-Id: Icfbe98b7ea0d64db3e934120f4a2966cb3f6ae19 Reviewed-on: https://code-review.googlesource.com/6912 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-16Remove the last #include directives from util/util.h.Paul Wankadia
Change-Id: I3e1a7f3644cec27adcfbd6f806851ec0d9223b38 Reviewed-on: https://code-review.googlesource.com/6835 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-16Tidy up the string utilities.Paul Wankadia
Change-Id: Ifd19a737b4a6a3e333aac64909a4694f7169786e Reviewed-on: https://code-review.googlesource.com/6832 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-11Make RE2::GlobalReplace() friendlier to UTF-8.Paul Wankadia
Fixes #104. Change-Id: I439034909011fcbde090dde502c619cfefe8f732 Reviewed-on: https://code-review.googlesource.com/6710 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-07Tidy up some uses of types.Paul Wankadia
Change-Id: I1107175085043160717d5049094e144736350fb0 Reviewed-on: https://code-review.googlesource.com/5553 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-07Use standard integer types.Paul Wankadia
Change-Id: I5d9f2df5500ca53c856efe200c34e1d330261bd8 Reviewed-on: https://code-review.googlesource.com/5551 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-02Remove more #include directives from util/util.h.Paul Wankadia
This time, it was also necessary to remove using declarations, which meant adding "std::" to everything. I left std::string alone for now, but added a couple of TODOs for it. Change-Id: Idc45d6587be3ac3a2be1c9c941b4bad5b7a3fdb3 Reviewed-on: https://code-review.googlesource.com/5443 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-08-02Start removing #include directives from util/util.h.Paul Wankadia
Of course, this entails adding them to individual source files. Change-Id: Iafa89975cfa736ac4c63559ec5e8ec88d4d97eb4 Reviewed-on: https://code-review.googlesource.com/5441 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-07-21Add LazyRE2, a "lazy static pointer" helper.Paul Wankadia
Change-Id: I7d268ed9709750bd910da3c48458c4faf9817291 Reviewed-on: https://code-review.googlesource.com/5320 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-04-01Don't test the strtof(3) edge case on Cygwin and MinGW.Paul Wankadia
Fixes #85. Change-Id: Ia5994995a763695b869cab74f9dbc85541b6f71f Reviewed-on: https://code-review.googlesource.com/4433 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-02-23Fix a couple of warnings from MSVC.Paul Wankadia
Change-Id: I7b67d47eb5028491279f543670262bf6d13693a9 Reviewed-on: https://code-review.googlesource.com/4237 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-02-22Don't build the RE2.NULTerminated test with MinGW.Paul Wankadia
Change-Id: I0e3502421a2346873e8857347257e837751b86dc Reviewed-on: https://code-review.googlesource.com/4232 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-02-14Fix bug in the BitState execution of the Fail instruction.Paul Wankadia
Change-Id: I209a846c67149dad2daed965e6a657a202522306 Reviewed-on: https://code-review.googlesource.com/4171 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-01-09Tweak a comment.Paul Wankadia
Change-Id: I1f88baae83bc923d6ac561492cf02e733d76d798 Reviewed-on: https://code-review.googlesource.com/3990 Reviewed-by: Paul Wankadia <junyer@google.com>
2016-01-08Fix bug caused by factoring of common prefixes in alternations.Paul Wankadia
Change-Id: Ic9c634e2ac0103e3fcdbc8af48a0415d0adfbf0f Reviewed-on: https://code-review.googlesource.com/3975 Reviewed-by: Paul Wankadia <junyer@google.com>
2015-12-17Clarify the behaviour when the input string is null.Paul Wankadia
Based on a patch written by Erik van der Poel. Change-Id: Ia14e3ebae79a008372bdc28f763c0abcc6f4b3a3 Reviewed-on: https://code-review.googlesource.com/3900 Reviewed-by: Paul Wankadia <junyer@google.com>
2015-11-01Tidy up integral types in various re2/testing/*.cc files.Paul Wankadia
For #65. Change-Id: I1688079cb01037edb84af72d44ae322016a86b44 Reviewed-on: https://code-review.googlesource.com/3704 Reviewed-by: Paul Wankadia <junyer@google.com>
2015-10-08Final tweaks for building with MSVC.Paul Wankadia
Fixes #56. Change-Id: I66c9043579638f6f4f106ab782ff06c9b40f5eae Reviewed-on: https://code-review.googlesource.com/3562 Reviewed-by: Paul Wankadia <junyer@google.com>
2015-10-08Check _POSIX_MAPPED_FILES in the RE2.NULTerminated test.Paul Wankadia
Change-Id: I8f5031d9670444227e8b925a07d94096bb88eca3 Reviewed-on: https://code-review.googlesource.com/3560 Reviewed-by: Paul Wankadia <junyer@google.com>
2015-06-22Call fwrite(), not write() or _write().Paul Wankadia
@nico pointed out that this would be cleaner and simpler than the #ifdef awkwardness that I had perpetrated. Fixes #30. Change-Id: Ied5f4bf37b03407dbc417c048dbd6dcafdfb077f Reviewed-on: https://code-review.googlesource.com/2903 Reviewed-by: Nico Weber <thakis@google.com> Reviewed-by: Paul Wankadia <junyer@google.com>
2015-06-17Tidy up some uses of test macros.Paul Wankadia
Change-Id: Ifbe3200923b060feecdd33a3bc1be375e98d8df7 Reviewed-on: https://code-review.googlesource.com/2870 Reviewed-by: Paul Wankadia <junyer@google.com>
2015-05-29Call CharClassBuilder::RemoveAbove() consistently.Paul Wankadia
By calling it from Regexp::ParseState::PushRegexp(), we cover every use of character classes. Previously, Unicode groups were not covered, which meant that handling them in Latin-1 mode would have bizarre results. As of this commit, the resulting character classes may be empty and, if so, simplified to NoMatch. I would argue that this is the expected behaviour under such nonsensical circumstances. This bug was discovered by the LLVM fuzzer. Change-Id: I00e20027045abfbd5d5e0efc56cd33df9c9e4b4f Reviewed-on: https://code-review.googlesource.com/2622 Reviewed-by: Russ Cox <rsc@swtch.com>
2015-04-30Add an experimental program fanout computation.Paul Wankadia
Change-Id: I92cc607d40d9370be7eba14fe258c08a6fff91c1 Reviewed-on: https://code-review.googlesource.com/2311 Reviewed-by: Russ Cox <rsc@swtch.com>
2015-04-27Rework a few character arrays.Paul Wankadia
In order to avoid narrowing conversion errors, cast each value to char explicitly. Note that the UTF-8 test already did it like this. Fixes #21. Change-Id: I88321547365dcafb806c70880522943fa0c88272 Reviewed-on: https://code-review.googlesource.com/2361 Reviewed-by: Paul Wankadia <junyer@google.com>
2014-12-18re2: three minor bug fixesRuss Cox
Found during testing inside Google. Change-Id: I93f824fd828b93b214c62b69b93d58f841b83bf1 Reviewed-on: https://code-review.googlesource.com/1593 Reviewed-by: Russ Cox <rsc@swtch.com>
2014-12-18re2: import various changes from Google's copyRuss Cox
Change-Id: I63bd284d742da393713dfdd0164d2ff38fd44920 Reviewed-on: https://code-review.googlesource.com/1592 Reviewed-by: Russ Cox <rsc@swtch.com>
2014-01-09re2: fix bitstate for empty char classesRuss Cox
Fixes issue 52. R=rsc CC=re2-dev https://codereview.appspot.com/50370043
2014-01-09re2: add dot_nl to the RE2::Options classMike Nazarewicz
This allows clients to set the ā€œsā€ flag by default for a given regular expression without the need to mess with the pattern by prefixing it with ā€œ(?s)ā€. This matters if the pattern comes from the user. Fixes issue 70. R=rsc CC=re2-dev https://codereview.appspot.com/44070048
2014-01-09re2: fixes for darwinRuss Cox
Probably will break other things. Thanks to various issue reporters for suggestions. Fixes issue 59. Fixes issue 76. Fixes issue 77. Fixes issue 81. Fixes issue 87. Fixes issue 90. Fixes issue 92. Fixes issue 94. R=rsc CC=re2-dev https://codereview.appspot.com/50270044
2013-08-01re2: reject non-Latin1 octal escapes in Latin1 modeRuss Cox
If they are not rejected in the parser, they end up triggering the CHECKs in prog.cc. Change the CHECKs to DCHECKs and recover. R=r CC=re2-dev https://codereview.appspot.com/12308043
2012-08-21re2: eliminate global c++ constructorsRuss Cox
R=battre, battre, digit, rsc, digit CC=re2-dev http://codereview.appspot.com/6442107
2012-07-17Add a "never capture" flag to RE2.Russ Cox
[Exported from internal Google RE2 repository.] R=rsc CC=re2-dev http://codereview.appspot.com/6412043
2011-10-23re2_test.cc: Ask sysconf() for pagesize rather than assuming multiple of 8kStefano Rivera
Tests fail on Debian/ia64 because ia64 has 16k pages, but we try to munmap an 8k page. Fixes issue 45 R=rsc CC=re2-dev http://codereview.appspot.com/5296045
2011-06-21re2: do not edit Regexp during IsAnchorStart, IsAnchorEndRuss Cox
Must never edit existing regexps: they are logically immutable. Was causing RE2::Regexp to give back the wrong answer. R=r CC=re2-dev http://codereview.appspot.com/4626065
2011-06-21export changes made at GoogleRuss Cox
R=rsc CC=re2-dev http://codereview.appspot.com/4625055
2011-03-02re2: add endpos to RE2::Match, fix bugsRuss Cox
Adding endpos to RE2::Match allows callers to limit the ending position of matches to points before the end of the text. Found and fixed a few bugs involving startpos and endpos not being handled properly. These would only affect callers using Match directly. They cannot affect callers using FullMatch, PartialMatch, and DoMatch, because those always use startpos == 0. R=r, rsc_swtch CC=re2-dev http://codereview.appspot.com/4237051
2011-02-01re2: add CapturingGroupNamesRuss Cox
Export from Google source tree. R=rsc CC=re2-dev http://codereview.appspot.com/3981051
2011-01-19re2 port cleanupRuss Cox
Use <unordered_set>, the new C++0x header, when possible. Use <tr1/unordered_set> otherwise. Delete unused util/hash_map.h. Silence a warning or two. R=r, r2 CC=re2-dev http://codereview.appspot.com/4049043
2010-10-11re2: fix (?i)[[:^lower:]] and (?i)\WRuss Cox
R=r CC=re2-dev http://codereview.appspot.com/2322045
2010-03-19re2_test: remove unnecessary rlimit callRuss Cox
was causing portability problems. Fixes issue 5. R=r CC=re2-dev http://codereview.appspot.com/666041
2010-03-10various updates and tweaks from GoogleRuss Cox
2010-03-02initial releaseRuss Cox