summaryrefslogtreecommitdiffstats
path: root/Lib/dos_8x3/test_str.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-09-11 19:07:45 (GMT)
committerGuido van Rossum <guido@python.org>1996-09-11 19:07:45 (GMT)
commit28d4ba24c9e56149ac618d66ed89abdc58e42f76 (patch)
tree461ef138fa6cd198652c540ba292140f3ea113aa /Lib/dos_8x3/test_str.py
parentc458e945a44fa0d937105f8daafc31bb56101aaf (diff)
downloadcpython-28d4ba24c9e56149ac618d66ed89abdc58e42f76.zip
cpython-28d4ba24c9e56149ac618d66ed89abdc58e42f76.tar.gz
cpython-28d4ba24c9e56149ac618d66ed89abdc58e42f76.tar.bz2
Another batch...
Diffstat (limited to 'Lib/dos_8x3/test_str.py')
-rw-r--r--Lib/dos_8x3/test_str.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/dos_8x3/test_str.py b/Lib/dos_8x3/test_str.py
new file mode 100644
index 0000000..5b2ddfb
--- /dev/null
+++ b/Lib/dos_8x3/test_str.py
@@ -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)