summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
diff options
context:
space:
mode:
authorGregory Szorc <gregory.szorc@gmail.com>2012-11-01 05:46:30 +0000
committerGregory Szorc <gregory.szorc@gmail.com>2012-11-01 05:46:30 +0000
commit245296ed403ce07f8d8c514b6ca500a80492fc8c (patch)
treeacc46fe8b3d5f58c047d196b6a1864bcf8a53458 /clang/bindings/python/tests
parentebe8c8cea23a138441ab5ab08fe62cf47a09e9d0 (diff)
downloadbcm5719-llvm-245296ed403ce07f8d8c514b6ca500a80492fc8c.tar.gz
bcm5719-llvm-245296ed403ce07f8d8c514b6ca500a80492fc8c.zip
[clang.py] Add Cursor.get_arguments()
Patch provided by Matthias Kleine <matthias_kleine@gmx.de> llvm-svn: 167216
Diffstat (limited to 'clang/bindings/python/tests')
-rw-r--r--clang/bindings/python/tests/cindex/test_cursor.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py
index 51695e20b0c..edb209b52b9 100644
--- a/clang/bindings/python/tests/cindex/test_cursor.py
+++ b/clang/bindings/python/tests/cindex/test_cursor.py
@@ -241,3 +241,12 @@ def test_get_tokens():
assert len(tokens) == 7
assert tokens[0].spelling == 'int'
assert tokens[1].spelling == 'foo'
+
+def test_get_arguments():
+ tu = get_tu('void foo(int i, int j);')
+ foo = get_cursor(tu, 'foo')
+ arguments = list(foo.get_arguments())
+
+ assert len(arguments) == 2
+ assert arguments[0].spelling == "i"
+ assert arguments[1].spelling == "j"
OpenPOWER on IntegriCloud