Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1001:3c18741f1708
Date: 2012-10-20 10:37 +0200
http://bitbucket.org/cffi/cffi/changeset/3c18741f1708/

Log:    Test for buffering issues in PyPy.

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -2233,9 +2233,10 @@
     #
     import posix
     fdr, fdw = posix.pipe()
-    fr1 = posix.fdopen(fdr, 'r')
-    fw1 = posix.fdopen(fdw, 'w')
+    fr1 = posix.fdopen(fdr, 'r', 256)
+    fw1 = posix.fdopen(fdw, 'w', 256)
     #
+    fw1.write(b"X")
     res = fputs(b"hello world\n", fw1)
     assert res >= 0
     fw1.close()
@@ -2243,7 +2244,7 @@
     p = newp(new_array_type(BCharP, 100), None)
     res = fscanf(fr1, b"%s\n", p)
     assert res == 1
-    assert string(p) == b"hello"
+    assert string(p) == b"Xhello"
     fr1.close()
 
 def test_FILE_only_for_FILE_arg():
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to