Commit 49f21743 authored by Guido van Rossum's avatar Guido van Rossum

Don't depend on str8.splitlines() in test_chunkcoding().

parent 3e623ba3
...@@ -31,8 +31,14 @@ class TestBase: ...@@ -31,8 +31,14 @@ class TestBase:
self.incrementaldecoder = self.codec.incrementaldecoder self.incrementaldecoder = self.codec.incrementaldecoder
def test_chunkcoding(self): def test_chunkcoding(self):
for native, utf8 in zip(*[map(bytes, str8(f).splitlines(1)) tstring_lines = []
for f in self.tstring]): for b in self.tstring:
lines = b.split(b"\n")
last = lines.pop()
assert last == b""
lines = [line + b"\n" for line in lines]
tstring_lines.append(lines)
for native, utf8 in zip(*tstring_lines):
u = self.decode(native)[0] u = self.decode(native)[0]
self.assertEqual(u, utf8.decode('utf-8')) self.assertEqual(u, utf8.decode('utf-8'))
if self.roundtriptest: if self.roundtriptest:
......
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