Update of /cvsroot/psyco/psyco/test
In directory sc8-pr-cvs1:/tmp/cvs-serv30004
Modified Files:
btrun.py
Log Message:
more Python 2.3 compatibility
Index: btrun.py
===================================================================
RCS file: /cvsroot/psyco/psyco/test/btrun.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** btrun.py 24 Mar 2003 13:29:19 -0000 1.4
--- btrun.py 26 Apr 2003 19:06:03 -0000 1.5
***************
*** 20,28 ****
... return 'exception: ' + sys.exc_info()[0].__name__
! >>> def truth(x):
! ... if x:
! ... return 'True'
... else:
! ... return 'False'
>>> PY21 = sys.hexversion < 0x02020000
--- 20,30 ----
... return 'exception: ' + sys.exc_info()[0].__name__
! >>> def assert_equal(x, y):
! ... if x == y:
! ... print 'Ok'
... else:
! ... print 'assert_equal failed: %r != %r' % (x,y)
!
! >>> True,False = 1==1,1==0
>>> PY21 = sys.hexversion < 0x02020000
***************
*** 33,36 ****
--- 35,50 ----
###################
+ >>> assert_equal(str('abcdefghijklmnop'=='abcdefghijklMNop'), str(False))
+ Ok
+
+ >>> assert_equal(str('abcdefghijklmnop'=='abcdefghijklmnop'), str(True))
+ Ok
+
+ >>> assert_equal(str((lambda x: x==1)(0)), str(False))
+ Ok
+
+ >>> assert_equal(str((lambda x: x==1)(1)), str(True))
+ Ok
+
>>> print test1.f1(217)
1115467
***************
*** 52,57 ****
[20, 14, 19, 9, 12, 25, 13, 9, 17, 23, 289, 26, 15, 13, 17, 19, 23, 18, 15, 14, 18, 22, 14, 18, 18, 17, 21, 27, 21, 20, 15, 12, 1745, 18, 17, 136, 25, 14, 27, 18, 92, 87, 386, 12, 52, 29, 63, 102, 49, 39, 26, 26, 18, 14, 16, 13, 22, 16, 29, 49, 24, 34, 30, 20, 16, 100, 98, 61, 20, 85, 61, 75, 54, 49, 19, 47, 32, 18, 67, 47, 86, 66, 184, 61, 42, 42, 74, 14, 26, 55, 74, 16, 37, 15, 19, 211, 17, 348, 369, 130, 12, 248, 264, 328, 162, 68, 69, 41, 128, 29, 240, 95, 244, 288, 673, 295, 108, 134, 380, 40, 42, 224, 137, 30, 15, 24, 11, 15, 6, 15, 19, 26, 19, 17, 15, 18, 16, 17, 11, 14, 11, 15, 11, 11, 19, 13, 18, 25, 14, 20, 12, 14, 8, 13, 17, 15, 16, 17, 15, 13, 12, 12, 10, 19, 15, 15, 16, 12, 24, 21, 14, 10, 19, 17, 14, 13, 20, 18, 11, 17, 21, 13, 21, 19, 17, 15, 19, 10, 17, 12, 16, 13, 16, 15, 13, 16, 16, 16, 15, 14, 11, 14, 18, 15, 25, 9, 19, 12, 13, 12, 18, 12, 13, 16, 13, 17, 18, 19, 16, 11, 18, 18, 27, 11, 22, 17, 13, 22, 20, 16, 9, 17, 14, 12, 20, 17, 15, 18, 16, 15, 15, 16, 16, 18, 18, 17, 21, 17, 12, 12, 17, 10, 20, 19, 18, 25]
! >>> print truth(PY21 or g1(test1.f4) == g1(test1.f5))
! True
>>> print test1.f6(n=100, p=10001)
--- 66,71 ----
[20, 14, 19, 9, 12, 25, 13, 9, 17, 23, 289, 26, 15, 13, 17, 19, 23, 18, 15, 14, 18, 22, 14, 18, 18, 17, 21, 27, 21, 20, 15, 12, 1745, 18, 17, 136, 25, 14, 27, 18, 92, 87, 386, 12, 52, 29, 63, 102, 49, 39, 26, 26, 18, 14, 16, 13, 22, 16, 29, 49, 24, 34, 30, 20, 16, 100, 98, 61, 20, 85, 61, 75, 54, 49, 19, 47, 32, 18, 67, 47, 86, 66, 184, 61, 42, 42, 74, 14, 26, 55, 74, 16, 37, 15, 19, 211, 17, 348, 369, 130, 12, 248, 264, 328, 162, 68, 69, 41, 128, 29, 240, 95, 244, 288, 673, 295, 108, 134, 380, 40, 42, 224, 137, 30, 15, 24, 11, 15, 6, 15, 19, 26, 19, 17, 15, 18, 16, 17, 11, 14, 11, 15, 11, 11, 19, 13, 18, 25, 14, 20, 12, 14, 8, 13, 17, 15, 16, 17, 15, 13, 12, 12, 10, 19, 15, 15, 16, 12, 24, 21, 14, 10, 19, 17, 14, 13, 20, 18, 11, 17, 21, 13, 21, 19, 17, 15, 19, 10, 17, 12, 16, 13, 16, 15, 13, 16, 16, 16, 15, 14, 11, 14, 18, 15, 25, 9, 19, 12, 13, 12, 18, 12, 13, 16, 13, 17, 18, 19, 16, 11, 18, 18, 27, 11, 22, 17, 13, 22, 20, 16, 9, 17, 14, 12, 20, 17, 15, 18, 16, 15, 15, 16, 16, 18, 18, 17, 21, 17, 12, 12, 17, 10, 20, 19, 18, 25]
! >>> assert_equal(PY21 or g1(test1.f4) == g1(test1.f5), 1)
! Ok
>>> print test1.f6(n=100, p=10001)
|