]> granicus.if.org Git - python/commitdiff
Add tests for re.L(OCALE).
authorGuido van Rossum <guido@python.org>
Tue, 30 Dec 1997 17:32:33 +0000 (17:32 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Dec 1997 17:32:33 +0000 (17:32 +0000)
Lib/test/test_re.py

index 83eab9fc52512acb664f7efb80c88e33edd14bda..99263b83da60dff1650ff27ac33183cc00a1eb8a 100644 (file)
@@ -134,7 +134,7 @@ try:
 except AssertionError:
     raise TestFailed, 're module constants'
 
-for flags in [re.I, re.M, re.X, re.S]:
+for flags in [re.I, re.M, re.X, re.S, re.L]:
     try:
        r = re.compile('^pattern$', flags)
     except:
@@ -229,4 +229,10 @@ for t in tests:
             if result==None:
                 print '=== Fails on case-insensitive match', t
 
+            # Try the match with LOCALE enabled, and check that it
+           # still succeeds.
+            obj=re.compile(pattern, re.LOCALE)
+            result=obj.search(s)
+            if result==None:
+                print '=== Fails on locale-sensitive match', t