]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix exceptions.TabError. _Please_ run test suite before checking in.
authorAnthony Baxter <anthonybaxter@gmail.com>
Fri, 3 Jun 2005 14:02:48 +0000 (14:02 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Fri, 3 Jun 2005 14:02:48 +0000 (14:02 +0000)
Lib/test/test_re.py

index c86f502c50d483ded3a456abbb57e46b6325506b..eab995de6e6565cdf0ca200793654a474607ba93 100644 (file)
@@ -235,15 +235,15 @@ class ReTests(unittest.TestCase):
         self.assertEqual(re.match('^(?:(a)|c)((?(1)|d))$', 'a').groups(),
                          ('a', ''))
 
-       # Tests for bug #1177831: exercise groups other than the first group
-       p = re.compile('(?P<g1>a)(?P<g2>b)?((?(g2)c|d))')
-       self.assertEqual(p.match('abc').groups(),
-                        ('a', 'b', 'c'))
-       self.assertEqual(p.match('ad').groups(),
-                        ('a', None, 'd'))
-       self.assertEqual(p.match('abd'), None)
-       self.assertEqual(p.match('ac'), None)
-       
+        # Tests for bug #1177831: exercise groups other than the first group
+        p = re.compile('(?P<g1>a)(?P<g2>b)?((?(g2)c|d))')
+        self.assertEqual(p.match('abc').groups(),
+                         ('a', 'b', 'c'))
+        self.assertEqual(p.match('ad').groups(),
+                         ('a', None, 'd'))
+        self.assertEqual(p.match('abd'), None)
+        self.assertEqual(p.match('ac'), None)
+
 
     def test_re_groupref(self):
         self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', '|a|').groups(),