summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-10-03 16:19:27 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-10-03 16:19:27 +0000
commit53f45c7d55355ff35b872aa3c9dd030c01a4d7ef (patch)
treedb6ba2b4af1617e3b87a9040d41644b70c391a90 /clang/bindings/python/tests
parent7a4253b68512edb5342047974f4080e5544dc027 (diff)
downloadbcm5719-llvm-53f45c7d55355ff35b872aa3c9dd030c01a4d7ef.tar.gz
bcm5719-llvm-53f45c7d55355ff35b872aa3c9dd030c01a4d7ef.zip
[libclang] python: expose a few functions, patch by Loïc Jaquemet!
llvm-svn: 191907
Diffstat (limited to 'clang/bindings/python/tests')
-rw-r--r--clang/bindings/python/tests/cindex/test_type.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_type.py b/clang/bindings/python/tests/cindex/test_type.py
index 62968d6285f..a02c06fe5a1 100644
--- a/clang/bindings/python/tests/cindex/test_type.py
+++ b/clang/bindings/python/tests/cindex/test_type.py
@@ -132,6 +132,22 @@ def test_equal():
assert a.type != None
assert a.type != 'foo'
+def test_type_spelling():
+ """Ensure Type.spelling works."""
+ tu = get_tu('int c[5]; int i[]; int x; int v[x];')
+ c = get_cursor(tu, 'c')
+ i = get_cursor(tu, 'i')
+ x = get_cursor(tu, 'x')
+ v = get_cursor(tu, 'v')
+ assert c is not None
+ assert i is not None
+ assert x is not None
+ assert v is not None
+ assert c.type.spelling == "int [5]"
+ assert i.type.spelling == "int []"
+ assert x.type.spelling == "int"
+ assert v.type.spelling == "int [x]"
+
def test_typekind_spelling():
"""Ensure TypeKind.spelling works."""
tu = get_tu('int a;')
OpenPOWER on IntegriCloud