From: Alex M. <al...@us...> - 2007-02-24 00:00:57
|
Update of /cvsroot/gmpy/gmpy/test In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv12232/test Modified Files: gmpy_test_cvr.py gmpy_test_dec.py gmpy_test_mpf.py gmpy_test_mpz.py gmpy_test_rnd.py Log Message: Clean up and make equivalent to the current "authoritative" release (now hosted on Google Code) 1.02 pre . Index: gmpy_test_cvr.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_cvr.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gmpy_test_cvr.py 22 Apr 2006 23:31:30 -0000 1.8 --- gmpy_test_cvr.py 24 Feb 2007 00:00:50 -0000 1.9 *************** *** 3,10 **** # test-version 1.02 r''' ! >>> print int(_g.gmp_version() in ('4.2', '4.1.4', '4.1.2', '4.0.1', '3.1.1')) 1 >>> _g.version() '1.02' ''' --- 3,12 ---- # test-version 1.02 r''' ! >>> print int(_g.gmp_version()[:3] in ('4.2', '4.1', '4.0', '3.1')) 1 >>> _g.version() '1.02' + >>> int('gmpy.c' in _g._cvsid()) + 1 ''' *************** *** 397,400 **** --- 399,404 ---- >>> _g.mpf(9,100)**_g.mpf(0.5) mpf('3.e0') + >>> _g.mpf(0)**2 + mpf('0.e0') >>> pow(_g.mpf(2),3,-5) Traceback (most recent call last): *************** *** 459,462 **** --- 463,474 ---- File "<stdin>", line 1, in ? ValueError: sqrt of negative number + >>> _g.jacobi(23, -34) + Traceback (most recent call last): + ... + ValueError: jacobi's y must be odd prime > 0 + >>> _g.legendre(23, -34) + Traceback (most recent call last): + ... + ValueError: legendre's y must be odd and > 0 ''' *************** *** 464,468 **** if chat: print "Unit tests for gmpy 1.02 release candidate (extra cover)" ! print " running on Python",sys.version print print "Testing gmpy %s (GMP %s) with default caching" \ --- 476,480 ---- if chat: print "Unit tests for gmpy 1.02 release candidate (extra cover)" ! print " running on Python", sys.version print print "Testing gmpy %s (GMP %s) with default caching" \ Index: gmpy_test_dec.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_dec.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gmpy_test_dec.py 22 Apr 2006 23:31:30 -0000 1.2 --- gmpy_test_dec.py 24 Feb 2007 00:00:50 -0000 1.3 *************** *** 54,58 **** def _test(chat=None): if chat: ! print "Unit tests for gmpy 1.1 release candidate (decimal interoperation)" print " running on Python",sys.version print --- 54,58 ---- def _test(chat=None): if chat: ! print "Unit tests for gmpy 1.02 release candidate (decimal interoperation)" print " running on Python",sys.version print Index: gmpy_test_mpf.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpf.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gmpy_test_mpf.py 22 Apr 2006 23:31:30 -0000 1.8 --- gmpy_test_mpf.py 24 Feb 2007 00:00:50 -0000 1.9 *************** *** 122,125 **** --- 122,127 ---- raise ValueError, what ValueError: sqrt of negative number + >>> _g.pi(64) + mpf('3.14159265358979323846e0',64) >>> ''' Index: gmpy_test_mpz.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpz.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gmpy_test_mpz.py 26 Feb 2006 07:36:59 -0000 1.12 --- gmpy_test_mpz.py 24 Feb 2007 00:00:50 -0000 1.13 *************** *** 10,14 **** ''' ! import gmpy as _g, doctest,sys __test__={} a=_g.mpz(123) --- 10,14 ---- ''' ! import gmpy as _g, doctest, sys, operator __test__={} a=_g.mpz(123) *************** *** 53,56 **** --- 53,76 ---- return factors + if sys.version[:3] >= '2.5': + __test__['index']=\ + r''' + >>> range(333)[a] + 123 + >>> range(333)[b] + Traceback (innermost last): + ... + IndexError: list index out of range + >>> ix = operator.index + >>> ix(_g.mpz(sys.maxint)) == sys.maxint + True + >>> type(ix(_g.mpz(sys.maxint))) is int + True + >>> ix(_g.mpz(sys.maxint+1)) == sys.maxint+1 + True + >>> type(ix(_g.mpz(sys.maxint+1))) is long + True + ''' + __test__['elemop']=\ r''' *************** *** 505,509 **** Traceback (most recent call last): File "<stdin>", line 1, in ? ! ValueError: legendres's y must be odd and > 0 >>> _g.legendre(3) Traceback (innermost last): --- 525,529 ---- Traceback (most recent call last): File "<stdin>", line 1, in ? ! ValueError: legendre's y must be odd and > 0 >>> _g.legendre(3) Traceback (innermost last): Index: gmpy_test_rnd.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_rnd.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gmpy_test_rnd.py 26 Feb 2006 07:08:19 -0000 1.6 --- gmpy_test_rnd.py 24 Feb 2007 00:00:50 -0000 1.7 *************** *** 108,115 **** plurotenk ekrnutplo ! >>> r('shuf','astring') ! Traceback (most recent call last): ! ... ! TypeError: object does not support item assignment >>> r('shuf',23) Traceback (most recent call last): --- 108,114 ---- plurotenk ekrnutplo ! >>> try: r('shuf','astring') ! ... except TypeError, e: print int('does not support item assignment' in str(e)) ! 1 >>> r('shuf',23) Traceback (most recent call last): |