summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests/cindex/test_cursor.py
diff options
context:
space:
mode:
authorGregory Szorc <gregory.szorc@gmail.com>2012-06-09 16:21:34 +0000
committerGregory Szorc <gregory.szorc@gmail.com>2012-06-09 16:21:34 +0000
commit531880af77b9121e1e39f8bc2bf6958d09c9e2bd (patch)
tree47e0fafea58b5bc437f809a80fad51630d14f364 /clang/bindings/python/tests/cindex/test_cursor.py
parentdf97aa16283ac6e36dc379b8a4dd0a41d7f39841 (diff)
downloadbcm5719-llvm-531880af77b9121e1e39f8bc2bf6958d09c9e2bd.tar.gz
bcm5719-llvm-531880af77b9121e1e39f8bc2bf6958d09c9e2bd.zip
[clang.py] Implement Cursor.is_static_method
llvm-svn: 158277
Diffstat (limited to 'clang/bindings/python/tests/cindex/test_cursor.py')
-rw-r--r--clang/bindings/python/tests/cindex/test_cursor.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py
index 9a37d2ff1b3..979838b21c7 100644
--- a/clang/bindings/python/tests/cindex/test_cursor.py
+++ b/clang/bindings/python/tests/cindex/test_cursor.py
@@ -102,6 +102,22 @@ def test_canonical():
assert len(cursors) == 3
assert cursors[1].canonical == cursors[2].canonical
+def test_is_static_method():
+ """Ensure Cursor.is_static_method works."""
+
+ source = 'class X { static void foo(); void bar(); };'
+ tu = get_tu(source, lang='cpp')
+
+ cls = get_cursor(tu, 'X')
+ foo = get_cursor(tu, 'foo')
+ bar = get_cursor(tu, 'bar')
+ assert cls is not None
+ assert foo is not None
+ assert bar is not None
+
+ assert foo.is_static_method()
+ assert not bar.is_static_method()
+
def test_underlying_type():
tu = get_tu('typedef int foo;')
typedef = get_cursor(tu, 'foo')
OpenPOWER on IntegriCloud