summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
Commit message (Collapse)AuthorAgeFilesLines
* - Issue #3629: Fix sre "bytecode" validator for an end case.Guido van Rossum2008-09-101-0/+4
| | | | Reviewed by Amaury.
* warnings.catch_warnings() now returns a list or None instead of the customBrett Cannon2008-09-091-2/+2
| | | | | | | | WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson.
* #3654: fix duplicate test method name. Review by Benjamin P.Georg Brandl2008-08-241-4/+2
|
* Closing issue1761.Amaury Forgeot d'Arc2008-01-101-0/+12
| | | | | | | | | | | | Surprising behaviour of the "$" regexp: it matches the end of the string, AND just before the newline at the end of the string:: re.sub('$', '#', 'foo\n') == 'foo#\n#' Python is consistent with Perl and the pcre library, so we just document it. Guido prefers "\Z" to match only the end of the string.
* Issue #1700, reported by Nguyen Quan Son, fix by Fredruk Lundh:Guido van Rossum2008-01-031-0/+30
| | | | | Regular Expression inline flags not handled correctly for some unicode characters. (Forward port from 2.5.2.)
* Fix issue 1661: Flags argument silently ignored in re functions with ↵Raymond Hettinger2007-12-191-0/+8
| | | | compiled regexes.
* Patch # 1140 (my code, approved by Effbot).Guido van Rossum2007-09-101-0/+25
| | | | | | | | | Make sure the type of the return value of re.sub(x, y, z) is the type of y+x (i.e. unicode if either is unicode, str if they are both str) even if there are no substitutions or if x==z (which triggered various special cases in join_list()). Could be backported to 2.5; no need to port to 3.0.
* Remove test.test_support.guard_warnings_filter.Brett Cannon2007-08-141-2/+2
| | | | | | | | test.test_support.catch_warning is more full-featured and provides the same functionality. Since guard_warnings_filter was added in 2.6 there is no backwards-compatibility issues.
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-1/+1
| | | | You might want to review this change as it's my first time. Be gentle. :-)
* Array module's buffer interface can now handle empty arrays.Raymond Hettinger2007-04-021-0/+7
|
* Bug #1675967: re patterns pickled with older Python versions canŽiga Seilnacht2007-03-211-1/+7
| | | | now be unpickled. Will backport.
* Rename sre.py -> re.pyNeal Norwitz2006-03-161-1/+1
|
* Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather thanGustavo Niemeyer2005-09-141-0/+3
| | | | considering it exactly like a '*'.
* M-x untabifyMichael W. Hudson2005-06-031-9/+9
|
* [Bug #1177831] Exercise (?(id)yes|no) for a group other than the first oneAndrew M. Kuchling2005-06-021-0/+10
|
* Whitespace normalization.Tim Peters2004-09-121-1/+1
|
* Fixing bug #817234, which made SRE get into an infinite loop onGustavo Niemeyer2004-09-031-0/+16
| | | | | empty final matches with finditer(). New test cases included for this bug and for #581080.
* Applying modified version of patch #1018386, which fixesGustavo Niemeyer2004-09-031-0/+53
| | | | some escaping bugs in SRE.
* Add weakref support to sockets and re pattern objects.Raymond Hettinger2004-05-311-0/+8
|
* Fix _sre.CODESIZE on 64-bit machines in UCS-4 mode. Fixes #931848.Martin v. Löwis2004-05-071-0/+9
| | | | Backported to 2.3.
* SF #926075: Fixed the bug that returns a wrong pattern object forHye-Shik Chang2004-04-201-0/+8
| | | | | a string or unicode object in sre.compile() when a different type pattern with the same value exists.
* Whitespace normalization.Tim Peters2004-01-181-1/+1
|
* Implemented non-recursive SRE matching.Gustavo Niemeyer2003-10-171-7/+7
|
* Fix and test for bug #764548:Just van Rossum2003-07-021-0/+10
| | | | | | Use isinstance() instead of comparing types directly, to enable subclasses of str and unicode to be used as patterns. Blessed by /F.
* fixed typo in commentJust van Rossum2003-07-021-1/+1
|
* Many new tests, based on gcov's coverage information.Gustavo Niemeyer2003-06-201-0/+172
| | | | | | From gcov's output (based on a locally changed _sre.c): 82.07% of 1372 source lines executed in file ./Modules/_sre.c
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-4/+2
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Fix for part of the problem mentioned in #725149 by Greg Chapman.Gustavo Niemeyer2003-04-271-0/+7
| | | | | | | | | | | | | | | | | | | This problem is related to a wrong behavior from mark_save/restore(), which don't restore the mark_stack_base before restoring the marks. Greg's suggestion was to change the asserts, which happen to be the only recursive ops that can continue the loop, but the problem would happen to any operation with the same behavior. So, rather than hardcoding this into asserts, I have changed mark_save/restore() to always restore the stackbase before restoring the marks. Both solutions should fix these two cases, presented by Greg: >>> re.match('(a)(?:(?=(b)*)c)*', 'abb').groups() ('b', None) >>> re.match('(a)((?!(b)*))*', 'abb').groups() ('b', None, None) The rest of the bug and patch in #725149 must be discussed further.
* Applied patch #725106, by Greg Chapman, fixing capturing groupsGustavo Niemeyer2003-04-271-0/+19
| | | | | | | | | | | | | | | | | | | | within repeats of alternatives. The only change to the original patch was to convert the tests to the new test_re.py file. This patch fixes cases like: >>> re.match('((a)|b)*', 'abc').groups() ('b', '') Which is wrong (it's impossible to match the empty string), and incompatible with other regex systems, like the following examples show: % perl -e '"abc" =~ /^((a)|b)*/; print "$1 $2\n";' b a % echo "abc" | sed -r -e "s/^((a)|b)*/\1 \2|/" b a|c
* final bit of tests converted from test_sreSkip Montanaro2003-04-251-8/+25
|
* more tests converted from test_sreSkip Montanaro2003-04-251-14/+35
|
* more tests from test_sreSkip Montanaro2003-04-251-2/+44
|
* copy a few tests from test_sreSkip Montanaro2003-04-251-0/+15
|
* Fix test_limitations(). The match there is *expected* to raiseGuido van Rossum2003-04-251-1/+6
| | | | RuntimeError.
* first cut at unittest version of re testsSkip Montanaro2003-04-241-374/+297
|
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-1/+1
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke.Guido van Rossum2001-08-101-0/+6
|
* SRE 2.1b1: don't do unicode tests under 1.5.2, or on unicodeFredrik Lundh2001-03-221-3/+8
| | | | strings/patterns.
* String method conversion.Eric S. Raymond2001-02-091-1/+1
| | | | (This one was trivial -- no actual string. references in it!)
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-171-74/+76
| | | | | | | and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* Update the code to better reflect recommended style:Fred Drake2000-12-121-11/+11
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* Make reindent.py happy (convert everything to 4-space indents!).Fred Drake2000-10-231-1/+1
|
* Better conformance to the Python Style Guide: use spaces around operators.Fred Drake2000-08-181-32/+33
|
* -- enabled some temporarily disabled RE testsFredrik Lundh2000-08-081-6/+32
| | | | | -- added basic unicode tests to test_re -- added test case for Sjoerd's xmllib problem to re_tests
* -- whitespace cleanup (more tests to be added in the next commit)Fredrik Lundh2000-08-081-23/+23
|
* Comment out repeated-group test for the momentAndrew M. Kuchling2000-08-031-1/+1
|
* Add nasty test case that overflows the stack with a repeated groupAndrew M. Kuchling2000-08-031-0/+4
|
* Switch to sre for regular expression matching (the new mini-re moduleGuido van Rossum2000-06-301-4/+4
| | | | | is actually by Fredrik Lundh). This will break the re tests -- Fredrik will fix this before the final release.
* Added tests for findall().Guido van Rossum1998-07-171-1/+21
| | | | | Added test for m.groups() with default. Added a few prints announcing various tests in verbose mode.