diff options
author | Guido van Rossum <guido@python.org> | 1993-03-29 11:30:50 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-03-29 11:30:50 (GMT) |
commit | e7113b6b3dd99b4d05fc81c18e1c2a94fa8e1ebb (patch) | |
tree | d779bf09fa3a7df8bd5876f398f353348f13f9de /Lib/test | |
parent | 04321d1e472ac2ffd06776f117a5ec14e76b7bb7 (diff) | |
download | cpython-e7113b6b3dd99b4d05fc81c18e1c2a94fa8e1ebb.zip cpython-e7113b6b3dd99b4d05fc81c18e1c2a94fa8e1ebb.tar.gz cpython-e7113b6b3dd99b4d05fc81c18e1c2a94fa8e1ebb.tar.bz2 |
* Fix bug in tzparse.py for DST timezone
* Added whatis command to pdb.py
* new module GET.py (GL definitions from <gl/get.h>)
* rect.py: is_empty takes a rect as argument, not two points.
* Added tests for builtin round() [XXX not yet complete!]
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_b2.py | 35 | ||||
-rw-r--r-- | Lib/test/testall.out | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py index f376f46..ca06049 100644 --- a/Lib/test/test_b2.py +++ b/Lib/test/test_b2.py @@ -123,6 +123,41 @@ if repr(()) <> '()': raise TestFailed, 'repr(())' if repr([]) <> '[]': raise TestFailed, 'repr([])' if repr({}) <> '{}': raise TestFailed, 'repr({})' +print 'round' +if round(0.0) <> 0.0: raise TestFailed, 'round(0.0)' +if round(1.0) <> 1.0: raise TestFailed, 'round(1.0)' +if round(10.0) <> 10.0: raise TestFailed, 'round(10.0)' +if round(1000000000.0) <> 1000000000.0: + raise TestFailed, 'round(1000000000.0)' +if round(1e20) <> 1e20: raise TestFailed, 'round(1e20)' + +if round(-1.0) <> -1.0: raise TestFailed, 'round(-1.0)' +if round(-10.0) <> -10.0: raise TestFailed, 'round(-10.0)' +if round(-1000000000.0) <> -1000000000.0: + raise TestFailed, 'round(-1000000000.0)' +if round(-1e20) <> -1e20: raise TestFailed, 'round(-1e20)' + +if round(0.1) <> 0.0: raise TestFailed, 'round(0.0)' +if round(1.1) <> 1.0: raise TestFailed, 'round(1.0)' +if round(10.1) <> 10.0: raise TestFailed, 'round(10.0)' +if round(1000000000.1) <> 1000000000.0: + raise TestFailed, 'round(1000000000.0)' + +if round(-1.1) <> -1.0: raise TestFailed, 'round(-1.0)' +if round(-10.1) <> -10.0: raise TestFailed, 'round(-10.0)' +if round(-1000000000.1) <> -1000000000.0: + raise TestFailed, 'round(-1000000000.0)' + +if round(0.9) <> 1.0: raise TestFailed, 'round(0.9)' +if round(9.9) <> 10.0: raise TestFailed, 'round(9.9)' +if round(999999999.9) <> 1000000000.0: + raise TestFailed, 'round(999999999.9)' + +if round(-0.9) <> -1.0: raise TestFailed, 'round(-0.9)' +if round(-9.9) <> -10.0: raise TestFailed, 'round(-9.9)' +if round(-999999999.9) <> -1000000000.0: + raise TestFailed, 'round(-999999999.9)' + print 'setattr' import sys setattr(sys, 'foobar', 1) diff --git a/Lib/test/testall.out b/Lib/test/testall.out index f81849b..a711ba2 100644 --- a/Lib/test/testall.out +++ b/Lib/test/testall.out @@ -92,6 +92,7 @@ testing testing reload repr +round setattr str type |