[Python-checkins] python/dist/src/Lib/test test_strptime.py,
1.19.4.3, 1.19.4.4
bcannon at users.sourceforge.net
bcannon at users.sourceforge.net
Thu Aug 28 20:34:24 EDT 2003
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv13077/Lib/test
Modified Files:
Tag: release23-maint
test_strptime.py
Log Message:
_strptime.srptime() escaped parentheses in the format string properly.
Closes bug #796149 .
Index: test_strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v
retrieving revision 1.19.4.3
retrieving revision 1.19.4.4
diff -C2 -d -r1.19.4.3 -r1.19.4.4
*** test_strptime.py 11 Aug 2003 07:19:06 -0000 1.19.4.3
--- test_strptime.py 29 Aug 2003 02:34:22 -0000 1.19.4.4
***************
*** 384,387 ****
--- 384,396 ----
" %s != %s" % (strp_output, defaults))
+ def test_escaping(self):
+ # Make sure all characters that have regex significance are escaped.
+ # Parentheses are in a purposeful order; will cause an error of
+ # unbalanced parentheses when the regex is compiled if they are not
+ # escaped.
+ # Test instigated by bug #796149 .
+ need_escaping = ".^$*+?{}\[]|)("
+ self.failUnless(_strptime.strptime(need_escaping, need_escaping))
+
class Strptime12AMPMTests(unittest.TestCase):
"""Test a _strptime regression in '%I %p' at 12 noon (12 PM)"""
More information about the Python-checkins
mailing list