예제 #1
0
 def test_neg(self):
     x = 42
     f1 = iobj.W_IntObject(x)
     v = iobj.neg__Int(self.space, f1)
     assert v.intval == -x
     x = -sys.maxint-1
     f1 = iobj.W_IntObject(x)
     assert self.space.w_OverflowError == (
                       self._unwrap_nonimpl(iobj.neg__Int, self.space, f1))
예제 #2
0
 def test_neg(self):
     x = 42
     f1 = iobj.W_IntObject(x)
     v = iobj.neg__Int(self.space, f1)
     assert v.intval == -x
     x = -sys.maxint - 1
     f1 = iobj.W_IntObject(x)
     assert self.space.w_OverflowError == (self._unwrap_nonimpl(
         iobj.neg__Int, self.space, f1))