summaryrefslogtreecommitdiff
path: root/bindings/python/tests/cindex/test_diagnostics.py
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/tests/cindex/test_diagnostics.py')
-rw-r--r--bindings/python/tests/cindex/test_diagnostics.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_diagnostics.py b/bindings/python/tests/cindex/test_diagnostics.py
index 48ab6176fd1df..ba6e545e8b1ab 100644
--- a/bindings/python/tests/cindex/test_diagnostics.py
+++ b/bindings/python/tests/cindex/test_diagnostics.py
@@ -80,3 +80,15 @@ def test_diagnostic_option():
assert d.option == '-Wunused-parameter'
assert d.disable_option == '-Wno-unused-parameter'
+
+def test_diagnostic_children():
+ tu = get_tu('void f(int x) {} void g() { f(); }')
+ assert len(tu.diagnostics) == 1
+ d = tu.diagnostics[0]
+
+ children = d.children
+ assert len(children) == 1
+ assert children[0].severity == Diagnostic.Note
+ assert children[0].spelling.endswith('declared here')
+ assert children[0].location.line == 1
+ assert children[0].location.column == 1