[Python-checkins] r45386 - python/trunk/Lib/test/test_codecs.py
walter.doerwald
python-checkins at python.org
Fri Apr 14 16:03:55 CEST 2006
Author: walter.doerwald
Date: Fri Apr 14 16:03:55 2006
New Revision: 45386
Modified:
python/trunk/Lib/test/test_codecs.py
Log:
Call encode()/decode() with final==True as the last call in the
incremental codec tests.
Modified: python/trunk/Lib/test/test_codecs.py
==============================================================================
--- python/trunk/Lib/test/test_codecs.py (original)
+++ python/trunk/Lib/test/test_codecs.py Fri Apr 14 16:03:55 2006
@@ -1044,20 +1044,24 @@
encodedresult = ""
for c in s:
encodedresult += encoder.encode(c)
+ encodedresult += encoder.encode(u"", True)
decoder = codecs.getincrementaldecoder(encoding)()
decodedresult = u""
for c in encodedresult:
decodedresult += decoder.decode(c)
+ decodedresult += decoder.decode("", True)
self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
# check C API
encodedresult = ""
for c in s:
encodedresult += cencoder.encode(c)
+ encodedresult += cencoder.encode(u"", True)
cdecoder = _testcapi.codec_incrementaldecoder(encoding)
decodedresult = u""
for c in encodedresult:
decodedresult += cdecoder.decode(c)
+ decodedresult += cdecoder.decode("", True)
self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
# check iterencode()/iterdecode()
More information about the Python-checkins
mailing list