MCPcopy Index your code
hub / github.com/python/cpython / test_negative_zero_repr_str

Method test_negative_zero_repr_str

Lib/test/test_complex.py:815–828  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

813
814 @support.requires_IEEE_754
815 def test_negative_zero_repr_str(self):
816 def test(v, expected, test_fn=self.assertEqual):
817 test_fn(repr(v), expected)
818 test_fn(str(v), expected)
819
820 test(complex(0., 1.), "1j")
821 test(complex(-0., 1.), "(-0+1j)")
822 test(complex(0., -1.), "-1j")
823 test(complex(-0., -1.), "(-0-1j)")
824
825 test(complex(0., 0.), "0j")
826 test(complex(0., -0.), "-0j")
827 test(complex(-0., 0.), "(-0+0j)")
828 test(complex(-0., -0.), "(-0-0j)")
829
830 def test_pos(self):
831 self.assertEqual(+(1+6j), 1+6j)

Callers

nothing calls this directly

Calls 1

testFunction · 0.70

Tested by

no test coverage detected