aboutsummaryrefslogtreecommitdiff
path: root/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
commite65b34deb1f8f7c80765f1c00476e7609bb9eada (patch)
treefe1d0b2cc047332c2ba78e4d5b2dd806149c9368 /bindings/python/tests/cindex/test_cursor.py
parentdb3d68f188eb0883407a25ef09c1d85e217b97ef (diff)
[clang.py] Implement Cursor.is_static_method
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/tests/cindex/test_cursor.py')
-rw-r--r--bindings/python/tests/cindex/test_cursor.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_cursor.py b/bindings/python/tests/cindex/test_cursor.py
index 9a37d2ff1b..979838b21c 100644
--- a/bindings/python/tests/cindex/test_cursor.py
+++ b/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')