Kaydet (Commit) f5910e42 authored tarafından Guido van Rossum's avatar Guido van Rossum

Add tests for re.L(OCALE).

üst 74608f8b
...@@ -134,7 +134,7 @@ try: ...@@ -134,7 +134,7 @@ try:
except AssertionError: except AssertionError:
raise TestFailed, 're module constants' 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: try:
r = re.compile('^pattern$', flags) r = re.compile('^pattern$', flags)
except: except:
...@@ -229,4 +229,10 @@ for t in tests: ...@@ -229,4 +229,10 @@ for t in tests:
if result==None: if result==None:
print '=== Fails on case-insensitive match', t 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment