Update big5hkscs codec to conform to the HKSCS:2004 revision.

This commit is contained in:
Hye-Shik Chang 2008-02-08 17:10:20 +00:00
parent 27d339446a
commit 01612e7dec
6 changed files with 1868 additions and 1777 deletions

View file

@ -323,9 +323,17 @@ class TestBase_Mapping(unittest.TestCase):
def _testpoint(self, csetch, unich):
if (csetch, unich) not in self.pass_enctest:
self.assertEqual(unich.encode(self.encoding), csetch)
try:
self.assertEqual(unich.encode(self.encoding), csetch)
except UnicodeError, exc:
self.fail('Encoding failed while testing %s -> %s: %s' % (
repr(unich), repr(csetch), exc.reason))
if (csetch, unich) not in self.pass_dectest:
self.assertEqual(unicode(csetch, self.encoding), unich)
try:
self.assertEqual(csetch.decode(self.encoding), unich)
except UnicodeError, exc:
self.fail('Decoding failed while testing %s -> %s: %s' % (
repr(csetch), repr(unich), exc.reason))
def load_teststring(encoding):
from test import cjkencodings_test