Author: Benjamin Peterson <benja...@python.org> Branch: Changeset: r44629:73323f28c8e8 Date: 2011-06-01 20:11 -0500 http://bitbucket.org/pypy/pypy/changeset/73323f28c8e8/
Log: why do (int/float).conjugate() have no tests? diff --git a/pypy/objspace/std/test/test_floatobject.py b/pypy/objspace/std/test/test_floatobject.py --- a/pypy/objspace/std/test/test_floatobject.py +++ b/pypy/objspace/std/test/test_floatobject.py @@ -63,6 +63,14 @@ def setup_class(cls): cls.w_py26 = cls.space.wrap(sys.version_info >= (2, 6)) + def test_conjugate(self): + assert (1.).conjugate() == 1. + assert (-1.).conjugate() == -1. + + class F(float): + pass + assert F(1.).conjugate() == 1. + def test_negatives(self): assert -1.1 < 0 assert -0.1 < 0 diff --git a/pypy/objspace/std/test/test_intobject.py b/pypy/objspace/std/test/test_intobject.py --- a/pypy/objspace/std/test/test_intobject.py +++ b/pypy/objspace/std/test/test_intobject.py @@ -285,6 +285,14 @@ class AppTestInt: + def test_conjugate(self): + assert (1).conjugate() == 1 + assert (-1).conjugate() == -1 + + class I(int): + pass + assert I(1).conjugate() == 1 + def test_trunc(self): import math assert math.trunc(1) == 1 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit