summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sre.py
Commit message (Collapse)AuthorAgeFilesLines
* test_sre is dead! long live test_re!Skip Montanaro2003-04-251-116/+0
|
* deleted more tests which were either already in test_re or that I migratedSkip Montanaro2003-04-251-76/+0
| | | | in the last revison
* Remove tests which were migrated to test_re.py. There are still more testsSkip Montanaro2003-04-251-262/+0
| | | | to migrate.
* More work on bug #672491 and patch #712900.Gustavo Niemeyer2003-04-201-1/+3
| | | | | | | | | | | | | | | | I've applied a modified version of Greg Chapman's patch. I've included the fixes without introducing the reorganization mentioned, for the sake of stability. Also, the second fix mentioned in the patch don't fix the mentioned problem anymore, because of the change introduced by patch #720991 (by Greg as well). The new fix wasn't complicated though, and is included as well. As a note. It seems that there are other places that require the "protection" of LASTMARK_SAVE()/LASTMARK_RESTORE(), and are just waiting for someone to find how to break them. Particularly, I belive that every recursion of SRE_MATCH() should be protected by these macros. I won't do that right now since I'm not completely sure about this, and we don't have much time for testing until the next release.
* Patch #681152: Support escaped Unicode characters in classes. Fixes #612074.Martin v. Löwis2003-04-191-0/+4
| | | | Will backport to 2.2.
* SF patch #720991 by Gary Herron:Guido van Rossum2003-04-141-0/+13
| | | | | | | A small fix for bug #545855 and Greg Chapman's addition of op code SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of pattern '*?' on a long string.
* Fixed bug #470582, using a modified version of patch #527371,Gustavo Niemeyer2002-11-061-0/+5
| | | | | | | | | | | | | | | | | | | from Greg Chapman. * Modules/_sre.c (lastmark_restore): New function, implementing algorithm to restore a state to a given lastmark. In addition to the similar algorithm used in a few places of SRE_MATCH, restore lastindex when restoring lastmark. (SRE_MATCH): Replace lastmark inline restoring by lastmark_restore(), function. Also include it where missing. In SRE_OP_MARK, set lastindex only if i > lastmark. * Lib/test/re_tests.py * Lib/test/test_sre.py Included regression tests for the fixed bugs. * Misc/NEWS Mention fixes.
* 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. :)
* bug #133283, #477728, #483789, #490573Fredrik Lundh2001-12-091-1/+1
| | | | | | | backed out of broken minimal repeat patch from July also fixed a couple of minor potential resource leaks in pattern_subx (Guido had already fixed the big one)
* Remove erroneous and confusing comment -- sre patterns *can* beGuido van Rossum2001-12-081-2/+2
| | | | | pickled and we do *not* expect exceptions from either pickle or cPickle.
* added finditer sanity checkFredrik Lundh2001-10-281-0/+11
|
* sre.split should return the last segment, even if emptyFredrik Lundh2001-10-221-0/+1
| | | | (sorry, barry)
* sre.Scanner fixes (from Greg Chapman). also added a Scanner sanityFredrik Lundh2001-10-211-0/+20
| | | | | | check to the test suite. added a few missing exception checks in the _sre module
* SRE bug #441409:Fredrik Lundh2001-10-181-0/+6
| | | | | | | | compile should raise error for non-strings SRE bug #432570, 448951: reset group after failed match also bumped version number to 2.2.0
* fixed #449964: sre.sub raises an exception if the template contains aFredrik Lundh2001-09-181-0/+3
| | | | | | \g<x> group reference followed by a character escape (also restructured a few things on the way to fixing #449000)
* an SRE bugfix a day keeps Guido away...Fredrik Lundh2001-09-181-0/+4
| | | | | | | #462270: sub-tle difference between pre.sub and sre.sub. PRE ignored an empty match at the previous location, SRE didn't. also synced with Secret Labs "sreopen" codebase.
* Patch #445762: Support --disable-unicodeMartin v. Löwis2001-08-171-5/+6
| | | | | | | | - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
* Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke.Guido van Rossum2001-08-101-0/+6
|
* reapplied darryl gallion's minimizing repeat fix. I'm still not 100%Fredrik Lundh2001-07-021-1/+1
| | | | | sure about this one, but test #133283 now works even with the fix in place, and so does the test suite. we'll see what comes up...
* SRE 2.1b2: increase the chances that the sre test works on otherFredrik Lundh2001-03-221-6/+3
| | | | machines...
* sre 2.1b2 update:Fredrik Lundh2001-03-221-0/+2
| | | | | | - take locale into account for word boundary anchors (#410271) - restored 2.0's *? behaviour (#233283, #408936 and others) - speed up re.sub/re.subn
* - restored 1.5.2 compatibility (sorry, eric)Fredrik Lundh2001-02-181-1/+1
| | | | | - removed __all__ cruft from internal modules (sorry, skip) - don't assume ASCII for string escapes (sorry, per)
* String method conversion.Eric S. Raymond2001-02-091-1/+1
| | | | (This one was trivial -- no actual string. references in it!)
* a bold attempt to fix things broken by MAL's verify patch: importFredrik Lundh2001-01-171-1/+1
| | | | 'verify' iff it's used by a test module...
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-171-1/+1
| | | | | | | 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.
* bumped SRE version number to 2.1. cleaned up and added 1.5.2Fredrik Lundh2001-01-161-7/+17
| | | | compatibility patches.
* -- don't use recursion for unbounded non-greedy repeatFredrik Lundh2001-01-141-1/+1
| | | | | | | | (bugs #115903, #115696) This is based on a patch by Darrel Gallion. I'm not 100% sure about this fix, but I haven't managed to come up with any test case it cannot handle...
* reapplied Fred's "recommended style" patch...Fredrik Lundh2001-01-141-8/+8
|
* SRE fixes for 2.1 alpha:Fredrik Lundh2001-01-141-8/+8
| | | | | | | | | | -- added some more docstrings -- fixed typo in scanner class (#125531) -- the multiline flag (?m) should't affect the \Z operator (#127259) -- fixed non-greedy backtracking bug (#123769, #127259) -- added sre.DEBUG flag (currently dumps the parsed pattern structure) -- fixed a couple of glitches in groupdict (the #126587 memory leak had already been fixed by AMK)
* Update the code to better reflect recommended style:Fred Drake2000-12-121-8/+8
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* -- properly reset groups in findall (bug #117612)Fredrik Lundh2000-10-281-0/+3
| | | | | | | | -- fixed negative lookbehind to work correctly at the beginning of the target string (bug #117242) -- improved syntax check; you can no longer refer to a group inside itself (bug #110866)
* - don't hang if group id is followed by whitespace (closes bug #114660)Fredrik Lundh2000-09-241-0/+3
|
* updated SRE test suite (fixes PEP223 problem, shows syntax errors)Fredrik Lundh2000-09-031-76/+78
|
* Repair failing test_sre.py.Tim Peters2000-09-031-3/+3
| | | | | | | | | This was a funny one! The test very subtly relied on 1.5.2's behavior of treating "\x%" as "\x%", i.e. ignoring that was an \x escape that didn't make sense. But /F implemented PEP 223, which causes 2.0 to raise an exception on the bad escape. Fixed by merely making the 3 such strings of this kind into raw strings.
* return -1 for undefined groups (as implemented in 1.5.2) instead ofFredrik Lundh2000-09-021-1/+6
| | | | None (as documented) from start/end/span. closes bug #113254
* -- tightened up parsing of octal numbersFredrik Lundh2000-09-021-189/+150
| | | | | -- improved the SRE test harness: don't use asserts, test a few more things (including more boundary conditions)
* -- changed findall to return empty strings instead of NoneFredrik Lundh2000-08-091-0/+1
| | | | for undefined groups
* -- added recursion limit (currently ~10,000 levels)Fredrik Lundh2000-08-031-0/+10
| | | | | | | -- improved error messages -- factored out SRE_COUNT; the same code is used by SRE_OP_REPEAT_ONE_TEMPLATE -- minor cleanups
* -- SRE 0.9.8: now that the bug is fixed, I might as well enableFredrik Lundh2000-08-011-4/+2
| | | | the test again...
* -- SRE 0.9.8: updated test scriptsFredrik Lundh2000-08-011-5/+6
|
* - added lookbehind support (?<=pattern), (?<!pattern).Fredrik Lundh2000-07-031-25/+25
| | | | | | | | | | | | | | | | | the pattern must have a fixed width. - got rid of array-module dependencies; the match pro- gram is now stored inside the pattern object, rather than in an extra string buffer. - cleaned up a various of potential leaks, api abuses, and other minors in the engine module. - use mal's new isalnum macro, rather than my own work- around. - untabified test_sre.py. seems like I removed a couple of trailing spaces in the process...
* - pedantic: make sure "python -t" doesn't complain...Fredrik Lundh2000-06-301-5/+5
|
* - fixed default value handling in group/groupdictFredrik Lundh2000-06-301-0/+385
- added test suite