|
123 | 123 | if repr([]) <> '[]': raise TestFailed, 'repr([])' |
124 | 124 | if repr({}) <> '{}': raise TestFailed, 'repr({})' |
125 | 125 |
|
| 126 | +print 'round' |
| 127 | +if round(0.0) <> 0.0: raise TestFailed, 'round(0.0)' |
| 128 | +if round(1.0) <> 1.0: raise TestFailed, 'round(1.0)' |
| 129 | +if round(10.0) <> 10.0: raise TestFailed, 'round(10.0)' |
| 130 | +if round(1000000000.0) <> 1000000000.0: |
| 131 | + raise TestFailed, 'round(1000000000.0)' |
| 132 | +if round(1e20) <> 1e20: raise TestFailed, 'round(1e20)' |
| 133 | + |
| 134 | +if round(-1.0) <> -1.0: raise TestFailed, 'round(-1.0)' |
| 135 | +if round(-10.0) <> -10.0: raise TestFailed, 'round(-10.0)' |
| 136 | +if round(-1000000000.0) <> -1000000000.0: |
| 137 | + raise TestFailed, 'round(-1000000000.0)' |
| 138 | +if round(-1e20) <> -1e20: raise TestFailed, 'round(-1e20)' |
| 139 | + |
| 140 | +if round(0.1) <> 0.0: raise TestFailed, 'round(0.0)' |
| 141 | +if round(1.1) <> 1.0: raise TestFailed, 'round(1.0)' |
| 142 | +if round(10.1) <> 10.0: raise TestFailed, 'round(10.0)' |
| 143 | +if round(1000000000.1) <> 1000000000.0: |
| 144 | + raise TestFailed, 'round(1000000000.0)' |
| 145 | + |
| 146 | +if round(-1.1) <> -1.0: raise TestFailed, 'round(-1.0)' |
| 147 | +if round(-10.1) <> -10.0: raise TestFailed, 'round(-10.0)' |
| 148 | +if round(-1000000000.1) <> -1000000000.0: |
| 149 | + raise TestFailed, 'round(-1000000000.0)' |
| 150 | + |
| 151 | +if round(0.9) <> 1.0: raise TestFailed, 'round(0.9)' |
| 152 | +if round(9.9) <> 10.0: raise TestFailed, 'round(9.9)' |
| 153 | +if round(999999999.9) <> 1000000000.0: |
| 154 | + raise TestFailed, 'round(999999999.9)' |
| 155 | + |
| 156 | +if round(-0.9) <> -1.0: raise TestFailed, 'round(-0.9)' |
| 157 | +if round(-9.9) <> -10.0: raise TestFailed, 'round(-9.9)' |
| 158 | +if round(-999999999.9) <> -1000000000.0: |
| 159 | + raise TestFailed, 'round(-999999999.9)' |
| 160 | + |
126 | 161 | print 'setattr' |
127 | 162 | import sys |
128 | 163 | setattr(sys, 'foobar', 1) |
|
0 commit comments