diff options
Diffstat (limited to 'Lib/dos-8x3/test_opc.py')
-rwxr-xr-x | Lib/dos-8x3/test_opc.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Lib/dos-8x3/test_opc.py b/Lib/dos-8x3/test_opc.py index b1e944b..656e00a 100755 --- a/Lib/dos-8x3/test_opc.py +++ b/Lib/dos-8x3/test_opc.py @@ -57,3 +57,38 @@ except AClass, v: try: raise BClass, a except TypeError: pass + + +print '2.3 comparing function objects' + +f = eval('lambda: None') +g = eval('lambda: None') +if f != g: raise TestFailed + +f = eval('lambda a: a') +g = eval('lambda a: a') +if f != g: raise TestFailed + +f = eval('lambda a=1: a') +g = eval('lambda a=1: a') +if f != g: raise TestFailed + +f = eval('lambda: 0') +g = eval('lambda: 1') +if f == g: raise TestFailed + +f = eval('lambda: None') +g = eval('lambda a: None') +if f == g: raise TestFailed + +f = eval('lambda a: None') +g = eval('lambda b: None') +if f == g: raise TestFailed + +f = eval('lambda a: None') +g = eval('lambda a=None: None') +if f == g: raise TestFailed + +f = eval('lambda a=0: None') +g = eval('lambda a=1: None') +if f == g: raise TestFailed |