[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.70,1.71

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 24 Sep 2001 09:51:56 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv7513/Lib/test

Modified Files:
	test_descr.py 
Log Message:
Change string comparison so that it applies even when one (or both)
arguments are subclasses of str, as long as they don't override rich
comparison.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** test_descr.py	2001/09/24 16:03:59	1.70
--- test_descr.py	2001/09/24 16:51:54	1.71
***************
*** 1556,1560 ****
              return self._rev
      s = madstring("abcdefghijklmnopqrstuvwxyz")
!     #XXX verify(s == "abcdefghijklmnopqrstuvwxyz")
      verify(s.rev() == madstring("zyxwvutsrqponmlkjihgfedcba"))
      verify(s.rev().rev() == madstring("abcdefghijklmnopqrstuvwxyz"))
--- 1556,1560 ----
              return self._rev
      s = madstring("abcdefghijklmnopqrstuvwxyz")
!     verify(s == "abcdefghijklmnopqrstuvwxyz")
      verify(s.rev() == madstring("zyxwvutsrqponmlkjihgfedcba"))
      verify(s.rev().rev() == madstring("abcdefghijklmnopqrstuvwxyz"))
***************
*** 1570,1579 ****
      base = "\x00" * 5
      s = madstring(base)
!     #XXX verify(s == base)
      verify(str(s) == base)
      verify(str(s).__class__ is str)
      verify(hash(s) == hash(base))
!     #XXX verify({s: 1}[base] == 1)
!     #XXX verify({base: 1}[s] == 1)
      verify((s + "").__class__ is str)
      verify(s + "" == base)
--- 1570,1579 ----
      base = "\x00" * 5
      s = madstring(base)
!     verify(s == base)
      verify(str(s) == base)
      verify(str(s).__class__ is str)
      verify(hash(s) == hash(base))
!     verify({s: 1}[base] == 1)
!     verify({base: 1}[s] == 1)
      verify((s + "").__class__ is str)
      verify(s + "" == base)
***************
*** 1614,1618 ****
  
      s = madstring("x y")
!     #XXX verify(s == "x y")
      verify(intern(s).__class__ is str)
      verify(intern(s) is intern("x y"))
--- 1614,1618 ----
  
      s = madstring("x y")
!     verify(s == "x y")
      verify(intern(s).__class__ is str)
      verify(intern(s) is intern("x y"))
***************
*** 1621,1625 ****
      i = intern("y x")
      s = madstring("y x")
!     #XXX verify(s == i)
      verify(intern(s).__class__ is str)
      verify(intern(s) is i)
--- 1621,1625 ----
      i = intern("y x")
      s = madstring("y x")
!     verify(s == i)
      verify(intern(s).__class__ is str)
      verify(intern(s) is i)