X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/e38168e25100c9bcf8e9784c0da1eb4605ce392f..71574cbaff3942fd35ceb2754cbfc36449856644:/t/t-mp.py diff --git a/t/t-mp.py b/t/t-mp.py index ec84d74..a1dd657 100644 --- a/t/t-mp.py +++ b/t/t-mp.py @@ -71,7 +71,12 @@ class TestMP (U.TestCase): me.assertEqual(str(y), '6556380541834372447694561492436749633') me.assertEqual(repr(y), 'MP(6556380541834372447694561492436749633)') me.assertEqual(hex(y), '0x4eeb684a0954ec4ceb255e3e9778d41') - me.assertEqual(oct(y), '047353320450112516611472622536175135706501') + me.assertEqual(oct(y), T.py23('0', '0o') + + '47353320450112516611472622536175135706501') + try: bin + except NameError: pass + else: me.assertEqual(bin(C.MP(661438603)), + '0b100111011011001100000010001011') def test_number(me): x, y, m, zero = C.MP(169), C.MP(24), C.MP(205), C.MP(0) @@ -413,7 +418,12 @@ class TestGF (U.TestCase): me.assertEqual(str(y), '0x4eeb684a0954ec4ceb255e3e9778d41') me.assertEqual(repr(y), 'GF(0x4eeb684a0954ec4ceb255e3e9778d41)') me.assertEqual(hex(y), '0x4eeb684a0954ec4ceb255e3e9778d41') - me.assertEqual(oct(y), '047353320450112516611472622536175135706501') + me.assertEqual(oct(y), T.py23('0', '0o') + + '47353320450112516611472622536175135706501') + try: bin + except NameError: pass + else: me.assertEqual(bin(C.GF(661438603)), + '0b100111011011001100000010001011') def test_number(me): x, y, m, zero = C.GF(0xa9), C.GF(0x18), C.GF(0x11b), C.GF(0)