[Python-checkins] CVS: python/dist/src/Lib/test test_compile.py,1.6,1.7
Tim Peters
tim_one@users.sourceforge.net
Mon, 27 Aug 2001 12:19:30 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv11755/python/Lib/test
Modified Files:
test_compile.py
Log Message:
SF bug [#455775] float parsing discrepancy.
PyTokenizer_Get: error if exponent contains no digits (3e, 2.0e+, ...).
Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** test_compile.py 2001/02/21 07:29:48 1.6
--- test_compile.py 2001/08/27 19:19:28 1.7
***************
*** 51,52 ****
--- 51,67 ----
except SyntaxError:
pass
+
+ if verbose:
+ print "testing bad float literals"
+
+ def expect_error(s):
+ try:
+ eval(s)
+ raise TestFailed("%r accepted" % s)
+ except SyntaxError:
+ pass
+
+ expect_error("2e")
+ expect_error("2.0e+")
+ expect_error("1e-")
+ expect_error("3-4e/21")