diff options
Diffstat (limited to 'Lib/test/test_b2.py')
| -rw-r--r-- | Lib/test/test_b2.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py index ca06049..037955e 100644 --- a/Lib/test/test_b2.py +++ b/Lib/test/test_b2.py @@ -111,6 +111,16 @@ finally: sys.stdin = savestdin fp.close() +print 'reduce' +if reduce('x,y:x+y', ['a', 'b', 'c'], '') <> 'abc': + raise TestFailed, 'reduce(): implode a string' +if reduce('x,y:x+y', [['a', 'c'], [], ['d', 'w']], []) <> ['a','c','d','w']: + raise TestFailed, 'reduce(): append' +if reduce('x,y: x*y', range(2,8), 1) <> 5040: + raise TestFailed, 'reduce(): compute 7!' +if reduce('x,y:x*y', range(2,21), 1L) <> 2432902008176640000L: + raise TestFailed, 'reduce(): compute 20!, use long' + print 'reload' import string reload(string) |
