summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2013-05-30 09:27:56 +0200
committerArmin Rigo <arigo@tunes.org>2013-05-30 09:27:56 +0200
commite8adc51142e255cdc8a45063fd8d6f2be803739e (patch)
tree75e883b4aa338b6fb7aefef5d90db377178bd063 /testing
parentc0bc61a7fdc45f04e8e427700f0f5b1495bf2442 (diff)
downloadcffi-e8adc51142e255cdc8a45063fd8d6f2be803739e.tar.gz
Issue #81 resolved: dir(ffi.verify(...))
Diffstat (limited to 'testing')
-rw-r--r--testing/test_verify.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/test_verify.py b/testing/test_verify.py
index 712744e..25bdd14 100644
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -1619,3 +1619,18 @@ def test_call_with_voidstar_arg():
ffi.cdef("int f(void *);")
lib = ffi.verify("int f(void *x) { return ((char*)x)[0]; }")
assert lib.f(b"foobar") == ord(b"f")
+
+def test_dir():
+ ffi = FFI()
+ ffi.cdef("""void somefunc(void);
+ extern int somevar, somearray[2];
+ static char *const sv2;
+ enum my_e { AA, BB, ... };
+ #define FOO ...""")
+ lib = ffi.verify("""void somefunc(void) { }
+ int somevar, somearray[2];
+ #define sv2 "text"
+ enum my_e { AA, BB };
+ #define FOO 42""")
+ assert dir(lib) == ['AA', 'BB', 'FOO', 'somearray',
+ 'somefunc', 'somevar', 'sv2']