[Python-checkins] CVS: python/dist/src/Lib/test re_tests.py,1.13,1.14
Fredrik Lundh
python-dev@python.org
Tue, 8 Aug 2000 09:52:54 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv16059/lib/test
Modified Files:
re_tests.py
Log Message:
-- whitespace cleanup (real changes coming in next checkin)
Index: re_tests.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** re_tests.py 1998/04/03 21:47:12 1.13
--- re_tests.py 2000/08/08 16:52:51 1.14
***************
*** 11,29 ****
#
# The benchmark suite does not test correctness, just speed. The
! # first element of each tuple is the regex pattern; the second is a
# string to match it against. The benchmarking code will embed the
! # second string inside several sizes of padding, to test how regex
# matching performs on large strings.
benchmarks = [
! ('Python', 'Python'), # Simple text literal
! ('.*Python', 'Python'), # Bad text literal
! ('.*Python.*', 'Python'), # Worse text literal
! ('.*(Python)', 'Python'), # Bad text literal with grouping
!
! ('(Python|Perl|Tcl', 'Perl'), # Alternation
! ('(Python|Perl|Tcl)', 'Perl'), # Grouped alternation
! ('(Python)\\1', 'PythonPython'), # Backreference
! ('([0a-z][a-z]*,)+', 'a5,b7,c9,'), # Disable the fastmap optimization
('([a-z][a-z0-9]*,)+', 'a5,b7,c9,') # A few sets
]
--- 11,29 ----
#
# The benchmark suite does not test correctness, just speed. The
! # first element of each tuple is the regex pattern; the second is a
# string to match it against. The benchmarking code will embed the
! # second string inside several sizes of padding, to test how regex
# matching performs on large strings.
benchmarks = [
! ('Python', 'Python'), # Simple text literal
! ('.*Python', 'Python'), # Bad text literal
! ('.*Python.*', 'Python'), # Worse text literal
! ('.*(Python)', 'Python'), # Bad text literal with grouping
!
! ('(Python|Perl|Tcl', 'Perl'), # Alternation
! ('(Python|Perl|Tcl)', 'Perl'), # Grouped alternation
! ('(Python)\\1', 'PythonPython'), # Backreference
! ('([0a-z][a-z]*,)+', 'a5,b7,c9,'), # Disable the fastmap optimization
('([a-z][a-z0-9]*,)+', 'a5,b7,c9,') # A few sets
]
***************
*** 48,52 ****
# If the regex isn't expected to work, the latter two elements can be omitted.
! tests = [
# Test ?P< and ?P= extensions
('(?P<foo_123', '', SYNTAX_ERROR), # Unterminated group identifier
--- 48,52 ----
# If the regex isn't expected to work, the latter two elements can be omitted.
! tests = [
# Test ?P< and ?P= extensions
('(?P<foo_123', '', SYNTAX_ERROR), # Unterminated group identifier
***************
*** 76,80 ****
(r'[a\0]', '\0', SUCCEED, 'found', '\0'),
(r'[^a\0]', '\0', FAIL),
!
# Test various letter escapes
(r'\a[\b]\f\n\r\t\v', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
--- 76,80 ----
(r'[a\0]', '\0', SUCCEED, 'found', '\0'),
(r'[^a\0]', '\0', FAIL),
!
# Test various letter escapes
(r'\a[\b]\f\n\r\t\v', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
***************
*** 87,93 ****
(r'\x00fe', '\376', SUCCEED, 'found', chr(254)),
! (r"^\w+=(\\[\000-\277]|[^\n\\])*", "SRC=eval.c g.c blah blah blah \\\\\n\tapes.c",
SUCCEED, 'found', "SRC=eval.c g.c blah blah blah \\\\"),
!
# Test that . only matches \n in DOTALL mode
('a.b', 'acb', SUCCEED, 'found', 'acb'),
--- 87,93 ----
(r'\x00fe', '\376', SUCCEED, 'found', chr(254)),
! (r"^\w+=(\\[\000-\277]|[^\n\\])*", "SRC=eval.c g.c blah blah blah \\\\\n\tapes.c",
SUCCEED, 'found', "SRC=eval.c g.c blah blah blah \\\\"),
!
# Test that . only matches \n in DOTALL mode
('a.b', 'acb', SUCCEED, 'found', 'acb'),
***************
*** 265,269 ****
('\\141', 'a', SUCCEED, 'found', 'a'),
('(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\119', 'abcdefghijklk9', SUCCEED, 'found+"-"+g11', 'abcdefghijklk9-k'),
!
# All tests from Perl
--- 265,269 ----
('\\141', 'a', SUCCEED, 'found', 'a'),
('(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\119', 'abcdefghijklk9', SUCCEED, 'found+"-"+g11', 'abcdefghijklk9-k'),
!
# All tests from Perl
***************
*** 545,555 ****
('w(?i)', 'W', SYNTAX_ERROR),
!
# Comments using the x embedded pattern modifier
("""(?x)w# comment 1
x y
! # comment 2
! z""", 'wxyz', SUCCEED, 'found', 'wxyz'),
# using the m embedded pattern modifier
--- 545,555 ----
('w(?i)', 'W', SYNTAX_ERROR),
!
# Comments using the x embedded pattern modifier
("""(?x)w# comment 1
x y
! # comment 2
! z""", 'wxyz', SUCCEED, 'found', 'wxyz'),
# using the m embedded pattern modifier
***************
*** 565,569 ****
xyzabc
123""", SUCCEED, 'found', 'abc'),
!
# using the s embedded pattern modifier
--- 565,569 ----
xyzabc
123""", SUCCEED, 'found', 'abc'),
!
# using the s embedded pattern modifier