[Python-checkins] CVS: python/dist/src/Lib/test re_tests.py,1.15,1.16

Fredrik Lundh python-dev@python.org
Thu, 31 Aug 2000 15:57:57 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv19734/Lib/test

Modified Files:
	re_tests.py 
Log Message:


closes bug #112468 (and all the other bugs that surfaced when
I fixed the a bug in the regression test harness...)


Index: re_tests.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** re_tests.py	2000/08/08 17:06:52	1.15
--- re_tests.py	2000/08/31 22:57:55	1.16
***************
*** 17,20 ****
--- 17,32 ----
  
  benchmarks = [
+ 
+     # test common prefix
+     ('Python|Perl', 'Perl'),    # Alternation
+     ('(Python|Perl)', 'Perl'),  # Grouped alternation
+ 
+     ('Python|Perl|Tcl', 'Perl'),        # Alternation
+     ('(Python|Perl|Tcl)', 'Perl'),      # Grouped alternation
+ 
+     ('(Python)\\1', 'PythonPython'),    # Backreference
+     ('([0a-z][a-z0-9]*,)+', 'a5,b7,c9,'), # Disable the fastmap optimization
+     ('([a-z][a-z0-9]*,)+', 'a5,b7,c9,'), # A few sets
+ 
      ('Python', 'Python'),               # Simple text literal
      ('.*Python', 'Python'),             # Bad text literal
***************
*** 22,30 ****
      ('.*(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
  ]
  
--- 34,37 ----
***************
*** 80,89 ****
      (r'\a[\b]\f\n\r\t\v', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
      (r'[\a][\b][\f][\n][\r][\t][\v]', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
!     (r'\u', '', SYNTAX_ERROR),    # A Perl escape
      (r'\c\e\g\h\i\j\k\m\o\p\q\y\z', 'ceghijkmopqyz', SUCCEED, 'found', 'ceghijkmopqyz'),
      (r'\xff', '\377', SUCCEED, 'found', chr(255)),
!     (r'\x00ffffffffffffff', '\377', SUCCEED, 'found', chr(255)),
!     (r'\x00f', '\017', SUCCEED, 'found', chr(15)),
!     (r'\x00fe', '\376', SUCCEED, 'found', chr(254)),
  
      (r"^\w+=(\\[\000-\277]|[^\n\\])*", "SRC=eval.c g.c blah blah blah \\\\\n\tapes.c",
--- 87,101 ----
      (r'\a[\b]\f\n\r\t\v', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
      (r'[\a][\b][\f][\n][\r][\t][\v]', '\a\b\f\n\r\t\v', SUCCEED, 'found', '\a\b\f\n\r\t\v'),
!     # NOTE: not an error under PCRE/PRE:
!     # (r'\u', '', SYNTAX_ERROR),    # A Perl escape
      (r'\c\e\g\h\i\j\k\m\o\p\q\y\z', 'ceghijkmopqyz', SUCCEED, 'found', 'ceghijkmopqyz'),
      (r'\xff', '\377', SUCCEED, 'found', chr(255)),
!     # new \x semantics
!     (r'\x00ffffffffffffff', '\377', FAIL, 'found', chr(255)),
!     (r'\x00f', '\017', FAIL, 'found', chr(15)),
!     (r'\x00fe', '\376', FAIL, 'found', chr(254)),
!     # (r'\x00ffffffffffffff', '\377', SUCCEED, 'found', chr(255)),
!     # (r'\x00f', '\017', SUCCEED, 'found', chr(15)),
!     # (r'\x00fe', '\376', SUCCEED, 'found', chr(254)),
  
      (r"^\w+=(\\[\000-\277]|[^\n\\])*", "SRC=eval.c g.c blah blah blah \\\\\n\tapes.c",
***************
*** 139,143 ****
      ('a[-b]', 'a-', SUCCEED, 'found', 'a-'),
      ('a[\\-b]', 'a-', SUCCEED, 'found', 'a-'),
!     ('a[b-]', 'a-', SYNTAX_ERROR),
      ('a[]b', '-', SYNTAX_ERROR),
      ('a[', '-', SYNTAX_ERROR),
--- 151,156 ----
      ('a[-b]', 'a-', SUCCEED, 'found', 'a-'),
      ('a[\\-b]', 'a-', SUCCEED, 'found', 'a-'),
!     # NOTE: not an error under PCRE/PRE:
!     # ('a[b-]', 'a-', SYNTAX_ERROR),
      ('a[]b', '-', SYNTAX_ERROR),
      ('a[', '-', SYNTAX_ERROR),
***************
*** 544,548 ****
      # Check odd placement of embedded pattern modifiers
  
!     ('w(?i)', 'W', SYNTAX_ERROR),
  
      # Comments using the x embedded pattern modifier
--- 557,563 ----
      # Check odd placement of embedded pattern modifiers
  
!     # not an error under PCRE/PRE:
!     ('w(?i)', 'W', SUCCEED, 'found', 'W'),
!     # ('w(?i)', 'W', SYNTAX_ERROR),
  
      # Comments using the x embedded pattern modifier
***************
*** 578,587 ****
      ('[\\D]+', '1234abc5678', SUCCEED, 'found', 'abc'),
      ('[\\da-fA-F]+', '123abc', SUCCEED, 'found', '123abc'),
!     ('[\\d-x]', '-', SYNTAX_ERROR),
      (r'([\s]*)([\S]*)([\s]*)', ' testing!1972', SUCCEED, 'g3+g2+g1', 'testing!1972 '),
      (r'(\s*)(\S*)(\s*)', ' testing!1972', SUCCEED, 'g3+g2+g1', 'testing!1972 '),
  
      (r'\xff', '\377', SUCCEED, 'found', chr(255)),
!     (r'\x00ff', '\377', SUCCEED, 'found', chr(255)),
      (r'\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
      ('\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
--- 593,605 ----
      ('[\\D]+', '1234abc5678', SUCCEED, 'found', 'abc'),
      ('[\\da-fA-F]+', '123abc', SUCCEED, 'found', '123abc'),
!     # not an error under PCRE/PRE:
!     # ('[\\d-x]', '-', SYNTAX_ERROR),
      (r'([\s]*)([\S]*)([\s]*)', ' testing!1972', SUCCEED, 'g3+g2+g1', 'testing!1972 '),
      (r'(\s*)(\S*)(\s*)', ' testing!1972', SUCCEED, 'g3+g2+g1', 'testing!1972 '),
  
      (r'\xff', '\377', SUCCEED, 'found', chr(255)),
!     # new \x semantics
!     (r'\x00ff', '\377', FAIL, 'found', chr(255)),
!     # (r'\x00ff', '\377', SUCCEED, 'found', chr(255)),
      (r'\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
      ('\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
***************
*** 589,596 ****
      (r'[\t][\n][\v][\r][\f][\b]', '\t\n\v\r\f\b', SUCCEED, 'found', '\t\n\v\r\f\b'),
  
!     # additional regression tests (1.6 and later)
  
      # xmllib problem
      (r'(([a-z]+):)?([a-z]+)$', 'smil', SUCCEED, 'g1+"-"+g2+"-"+g3', 'None-None-smil'),
! 
  ]
--- 607,619 ----
      (r'[\t][\n][\v][\r][\f][\b]', '\t\n\v\r\f\b', SUCCEED, 'found', '\t\n\v\r\f\b'),
  
!     #
!     # post-1.5.2 additions
  
      # xmllib problem
      (r'(([a-z]+):)?([a-z]+)$', 'smil', SUCCEED, 'g1+"-"+g2+"-"+g3', 'None-None-smil'),
!     # bug 111869 (PRE/PCRE fails on this one, SRE doesn't)
!     (r'.*d', 'abc\nabd', SUCCEED, 'found', 'abd'),
!     # bug 112468
!     ('(', '', SYNTAX_ERROR),
!     ('[\\41]', '!', SUCCEED, 'found', '!'),
  ]