summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_compile.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 17d3500..0276ba6 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -50,3 +50,18 @@ try:
raise TestFailed, "non-default args after default"
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")