summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_b2.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-11-27 22:53:50 (GMT)
committerGuido van Rossum <guido@python.org>1992-11-27 22:53:50 (GMT)
commit85f1820ee15faec7961056ace378f2d444419c1c (patch)
tree41ccba707377e7df1229b0dd8806217dee497fbc /Lib/test/test_b2.py
parentd014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0 (diff)
downloadcpython-85f1820ee15faec7961056ace378f2d444419c1c.zip
cpython-85f1820ee15faec7961056ace378f2d444419c1c.tar.gz
cpython-85f1820ee15faec7961056ace378f2d444419c1c.tar.bz2
Added some new tests and two new files for testing: test_types.py
(testing operations on built-in types) and autotest.py (automatic regression testing).
Diffstat (limited to 'Lib/test/test_b2.py')
-rw-r--r--Lib/test/test_b2.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py
index a4bea24..568ed97 100644
--- a/Lib/test/test_b2.py
+++ b/Lib/test/test_b2.py
@@ -115,11 +115,27 @@ print 'reload'
import string
reload(string)
+print 'repr'
+if repr('') <> '\'\'': raise TestFailed, 'repr(\'\')'
+if repr(0) <> '0': raise TestFailed, 'repr(0)'
+if repr(0L) <> '0L': raise TestFailed, 'repr(0L)'
+if repr(()) <> '()': raise TestFailed, 'repr(())'
+if repr([]) <> '[]': raise TestFailed, 'repr([])'
+if repr({}) <> '{}': raise TestFailed, 'repr({})'
+
print 'setattr'
import sys
setattr(sys, 'foobar', 1)
if sys.foobar != 1: raise TestFailed, 'setattr(sys, \'foobar\', 1)'
+print 'str'
+if str('') <> '': raise TestFailed, 'str(\'\')'
+if str(0) <> '0': raise TestFailed, 'str(0)'
+if str(0L) <> '0L': raise TestFailed, 'str(0L)'
+if str(()) <> '()': raise TestFailed, 'str(())'
+if str([]) <> '[]': raise TestFailed, 'str([])'
+if str({}) <> '{}': raise TestFailed, 'str({})'
+
print 'type'
if type('') <> type('123') or type('') == type(()):
raise TestFailed, 'type()'