From fdee0f0aa779fbe648cebe68878e9be5dc47e0bd Mon Sep 17 00:00:00 2001 From: Peter Schneider-Kamp Date: Tue, 25 Jul 2000 22:15:45 +0000 Subject: [PATCH] added test case for fixed duplicate arguments bug in Python/compile.c --- Lib/test/output/test_compile | 1 + Lib/test/test_compile.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Lib/test/output/test_compile create mode 100644 Lib/test/test_compile.py diff --git a/Lib/test/output/test_compile b/Lib/test/output/test_compile new file mode 100644 index 00000000000..357f96d4b88 --- /dev/null +++ b/Lib/test/output/test_compile @@ -0,0 +1 @@ +test_compile diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py new file mode 100644 index 00000000000..8905864a914 --- /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