~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp.c: Convert shift amounts via `index' to prevent `float' and `str'.
[catacomb-python]
/
t
/
t-mp.py
diff --git
a/t/t-mp.py
b/t/t-mp.py
index
ec84d74
..
a1dd657
100644
(file)
--- 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(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)
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(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)
def test_number(me):
x, y, m, zero = C.GF(0xa9), C.GF(0x18), C.GF(0x11b), C.GF(0)