Another batch...

This commit is contained in:
Guido van Rossum 1996-09-11 19:07:45 +00:00
parent c458e945a4
commit 28d4ba24c9
8 changed files with 54 additions and 28 deletions

21
Lib/dos-8x3/test_str.py Normal file
View file

@ -0,0 +1,21 @@
import strop, sys
def test(name, input, output):
f = getattr(strop, name)
try:
value = f(input)
except:
value = sys.exc_type
print sys.exc_value
if value != output:
print f, `input`, `output`, `value`
test('atoi', " 1 ", 1)
test('atoi', " 1x", ValueError)
test('atoi', " x1 ", ValueError)
test('atol', " 1 ", 1L)
test('atol', " 1x ", ValueError)
test('atol', " x1 ", ValueError)
test('atof', " 1 ", 1.0)
test('atof', " 1x ", ValueError)
test('atof', " x1 ", ValueError)