summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorPeter Schneider-Kamp <nowonder@nowonder.de>2000-07-25 22:15:45 (GMT)
committerPeter Schneider-Kamp <nowonder@nowonder.de>2000-07-25 22:15:45 (GMT)
commitfdee0f0aa779fbe648cebe68878e9be5dc47e0bd (patch)
tree99ecadd78dd7aec99b13e8741c9c9ff1ba21b0bd /Lib/test/test_compile.py
parent1cb3a9ecef81ac9c3f51e336c7155b2312f47f6d (diff)
downloadcpython-fdee0f0aa779fbe648cebe68878e9be5dc47e0bd.zip
cpython-fdee0f0aa779fbe648cebe68878e9be5dc47e0bd.tar.gz
cpython-fdee0f0aa779fbe648cebe68878e9be5dc47e0bd.tar.bz2
added test case for fixed duplicate arguments bug in Python/compile.c
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
new file mode 100644
index 0000000..8905864
--- /dev/null
+++ b/Lib/test/test_compile.py
@@ -0,0 +1,16 @@
+from test_support import verbose, TestFailed
+
+if verbose:
+ print 'Running test on duplicate arguments'
+
+try:
+ exec('def f(a, a): pass')
+ raise TestFailed, "duplicate arguments"
+except SyntaxError:
+ pass
+
+try:
+ exec('def f(a = 0, a = 1): pass')
+ raise TestFailed, "duplicate keyword arguments"
+except SyntaxError:
+ pass