Commit 67b71c0f authored by Walter Dörwald's avatar Walter Dörwald

Add a test for UTF-16 reading where the byte sequence doesn't start with

a BOM.
parent 156005b6
......@@ -159,6 +159,15 @@ class UTF16Test(ReadTest):
f = reader(s)
self.assertEquals(f.read(), u"spamspam")
def test_badbom(self):
s = StringIO.StringIO("\xff\xff")
f = codecs.getwriter(self.encoding)(s)
self.assertRaises(UnicodeError, f.read)
s = StringIO.StringIO("\xff\xff\xff\xff")
f = codecs.getwriter(self.encoding)(s)
self.assertRaises(UnicodeError, f.read)
def test_partial(self):
self.check_partial(
u"\x00\xff\u0100\uffff",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment