Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r2705:847bbc0297f8
Date: 2016-06-03 14:18 +0200
http://bitbucket.org/cffi/cffi/changeset/847bbc0297f8/

Log:    Add a test for another use case

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -2704,6 +2704,13 @@
     p[1:3] = bytearray(b"XY")
     assert list(p) == [b"f", b"X", b"Y", b".", b"\x00"]
 
+def test_string_assignment_to_byte_array():
+    BByteArray = new_array_type(
+        new_pointer_type(new_primitive_type("unsigned char")), None)
+    p = newp(BByteArray, 5)
+    p[0:3] = bytearray(b"XYZ")
+    assert list(p) == [ord("X"), ord("Y"), ord("Z"), 0, 0]
+
 # XXX hack
 if sys.version_info >= (3,):
     try:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to