[pypy-commit] cffi default: Another test.
arigo
noreply at buildbot.pypy.org
Sun Jun 24 18:15:32 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r504:c0350a2a6c51
Date: 2012-06-24 18:14 +0200
http://bitbucket.org/cffi/cffi/changeset/c0350a2a6c51/
Log: Another test.
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -943,3 +943,13 @@
u1 = newp(BUnionPtr, 42)
u2 = newp(BUnionPtr, u1[0])
assert u2.a1 == 42
+
+def test_str():
+ BChar = new_primitive_type("char")
+ BCharP = new_pointer_type(BChar)
+ BArray = new_array_type(BCharP, 10)
+ a = newp(BArray, "hello")
+ assert len(a) == 10
+ assert str(a) == "hello"
+ p = a + 2
+ assert str(p) == "llo"
More information about the pypy-commit
mailing list