Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / lib / python2.4 / test / test_codecencodings_tw.py
CommitLineData
920dae64
AT
1#!/usr/bin/env python
2#
3# test_codecencodings_tw.py
4# Codec encoding tests for ROC encodings.
5#
6# $CJKCodecs: test_codecencodings_tw.py,v 1.2 2004/06/19 06:09:55 perky Exp $
7
8from test import test_support
9from test import test_multibytecodec_support
10import unittest
11
12class Test_Big5(test_multibytecodec_support.TestBase, unittest.TestCase):
13 encoding = 'big5'
14 tstring = test_multibytecodec_support.load_teststring('big5')
15 codectests = (
16 # invalid bytes
17 ("abc\x80\x80\xc1\xc4", "strict", None),
18 ("abc\xc8", "strict", None),
19 ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u8b10"),
20 ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u8b10\ufffd"),
21 ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u8b10"),
22 )
23
24def test_main():
25 suite = unittest.TestSuite()
26 suite.addTest(unittest.makeSuite(Test_Big5))
27 test_support.run_suite(suite)
28
29if __name__ == "__main__":
30 test_main()