[Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.12,1.13
M.-A. Lemburg
python-dev@python.org
Tue, 13 Jun 2000 05:05:39 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv11480/Lib/test
Modified Files:
test_unicode.py
Log Message:
Marc-Andre Lemburg <mal@lemburg.com>:
Fixed some tests to not cause the script to fail, but rather
output a warning (which then is caught by regrtest.py as wrong
output). This is needed to make test_unicode.py run through
on JPython.
Thanks to Finn Bock.
Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** test_unicode.py 2000/06/08 17:50:55 1.12
--- test_unicode.py 2000/06/13 12:05:36 1.13
***************
*** 252,258 ****
assert u"%c" % (34,) == u'"'
assert u"%c" % (36,) == u'$'
! assert u"%r, %r" % (u"abc", "abc") == u"u'abc', 'abc'"
assert u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def'
! assert u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"} == u'abc, def'
# formatting jobs delegated from the string implementation:
assert '...%(foo)s...' % {'foo':u"abc"} == u'...abc...'
--- 252,267 ----
assert u"%c" % (34,) == u'"'
assert u"%c" % (36,) == u'$'
! value = u"%r, %r" % (u"abc", "abc")
! if value != u"u'abc', 'abc'":
! print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
!
assert u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def'
! try:
! value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"}
! except KeyError:
! print '*** formatting failed for "%s"' % "u'abc, def'"
! else:
! assert value == u'abc, def'
!
# formatting jobs delegated from the string implementation:
assert '...%(foo)s...' % {'foo':u"abc"} == u'...abc...'
***************
*** 269,273 ****
pass
else:
! raise AssertionError, "'...%s...äöü...' % u'abc' failed to raise an exception"
print 'done.'
--- 278,282 ----
pass
else:
! print "*** formatting failed ...%s...äöü...' % u'abc' failed to raise an exception"
print 'done.'