[pypy-svn] pypy default: Added a test that crashes on pypy-c.

alex_gaynor commits-noreply at bitbucket.org
Wed Feb 2 16:00:51 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r41561:0a31526bc07b
Date: 2011-02-02 10:00 -0500
http://bitbucket.org/pypy/pypy/changeset/0a31526bc07b/

Log:	Added a test that crashes on pypy-c.

diff --git a/pypy/module/_io/test/test_textio.py b/pypy/module/_io/test/test_textio.py
--- a/pypy/module/_io/test/test_textio.py
+++ b/pypy/module/_io/test/test_textio.py
@@ -166,6 +166,21 @@
                         assert got_line == exp_line
                     assert len(got_lines) == len(exp_lines)
 
+    def test_readline(self):
+        import _io
+
+        s = "AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
+        r = "AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
+        txt = _io.TextIOWrapper(_io.BytesIO(s), encoding="ascii")
+        txt._CHUNK_SIZE = 4
+
+        reads = txt.read(4)
+        reads += txt.read(4)
+        reads += txt.readline()
+        reads += txt.readline()
+        reads += txt.readline()
+        assert reads == r
+
     def test_name(self):
         import _io
 


More information about the Pypy-commit mailing list