[pypy-commit] cffi default: Allow different formattings of the underlying "%p"

arigo noreply at buildbot.pypy.org
Tue Nov 3 02:59:15 EST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2369:17abd378d528
Date: 2015-11-03 09:00 +0100
http://bitbucket.org/cffi/cffi/changeset/17abd378d528/

Log:	Allow different formattings of the underlying "%p"

diff --git a/testing/cffi0/test_parsing.py b/testing/cffi0/test_parsing.py
--- a/testing/cffi0/test_parsing.py
+++ b/testing/cffi0/test_parsing.py
@@ -261,7 +261,8 @@
     ffi = FFI()
     ffi.cdef("typedef int bool, *FILE;")
     assert repr(ffi.cast("bool", 123)) == "<cdata 'int' 123>"
-    assert repr(ffi.cast("FILE", 123)) == "<cdata 'int *' 0x7b>"
+    assert re.match(r"<cdata 'int [*]' 0[xX]?0*7[bB]>",
+                    repr(ffi.cast("FILE", 123)))
     ffi = FFI()
     ffi.cdef("typedef bool (*fn_t)(bool, bool);")   # "bool," but within "( )"
 


More information about the pypy-commit mailing list