* string.py: added rindex(), rfind(); changed index() to interpret
negative start indices starting from the right.
* ftplib.py: debug() -> set_debuglevel(); change demo to use __init__().
* os.py: added execl, execlp, and execvp.
* lambda.py: removed (now that we have built-in map, reduce, bagof, lambda)
* test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce
* commands.py: use os, not posix
* test_grammar.py: make it easy to disable non-portable int overflow tests
* dis.py: don't abuse range()
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 @@
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)