summaryrefslogtreecommitdiffstats
path: root/bindings/python/tests
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2012-02-05 11:42:25 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2012-02-05 11:42:25 +0000
commiteb9ff2ea9ed829809cb177e74238301cfc2750ca (patch)
tree4490582b7b3cbe8486e978e05759aba8987c9de9 /bindings/python/tests
parent28d939ffd6877f8a2c6a5b6704df792319f3878e (diff)
[clang.py] Implement Cursor.enum_type
Contributed by: Gregory Szorc <gregory.szorc@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/tests')
-rw-r--r--bindings/python/tests/cindex/test_cursor.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_cursor.py b/bindings/python/tests/cindex/test_cursor.py
index d86830334d..71ee0c5763 100644
--- a/bindings/python/tests/cindex/test_cursor.py
+++ b/bindings/python/tests/cindex/test_cursor.py
@@ -77,3 +77,18 @@ def test_underlying_type():
assert typedef.kind.is_declaration()
underlying = typedef.underlying_typedef_type
assert underlying.kind == TypeKind.INT
+
+def test_enum_type():
+ source = 'enum TEST { FOO=1, BAR=2 };'
+ index = Index.create()
+ tu = index.parse('test.c', unsaved_files=[('test.c', source)])
+ assert tu is not None
+
+ for cursor in tu.cursor.get_children():
+ if cursor.spelling == 'TEST':
+ enum = cursor
+ break
+
+ assert enum.kind == CursorKind.ENUM_DECL
+ enum_type = enum.enum_type
+ assert enum_type.kind == TypeKind.UINT