[pypy-commit] cffi default: extra test

arigo pypy.commits at gmail.com
Sun Jun 4 07:28:46 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2971:a5114b7d3887
Date: 2017-06-04 13:28 +0200
http://bitbucket.org/cffi/cffi/changeset/a5114b7d3887/

Log:	extra test

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -2265,6 +2265,11 @@
     py.test.raises(TypeError, newp, BChar16A, [x])
     x = cast(BChar16, 'A')
     py.test.raises(TypeError, newp, BChar32A, [x])
+    #
+    a = newp(BChar16A, u+'\U00012345')
+    assert len(a) == 3
+    a = newp(BChar32A, u+'\U00012345')
+    assert len(a) == 2   # even if the Python unicode string above is 2 chars
 
 def test_keepalive_struct():
     # exception to the no-keepalive rule: p=newp(BStructPtr) returns a


More information about the pypy-commit mailing list