@@ -0,0 +1,1414 @@
+from clang.cindex import Index, CursorKind%0A%0AkInput = %22%22%22%5C%0A// FIXME: Find nicer way to drop builtins and other cruft.%0Aint start_decl;%0A%0Astruct s0 %7B%0A  int a;%0A  int b;%0A%7D;%0A%0Astruct s1;%0A%0Avoid f0(int a0, int a1) %7B%0A  int l0, l1;%0A%0A  if (a0)%0A    return;%0A%0A  for (;;) %7B%0A    break;%0A  %7D%0A%7D%0A%22%22%22%0A%0Adef test_get_children():%0A    index = Index.create(1, 1)%0A    tu = index.parse('t.c', unsaved_files = %5B('t.c',kInput)%5D)%0A    %0A    # Skip until past start_decl.%0A    it = tu.cursor.get_children()%0A    while it.next().spelling != 'start_decl':%0A        pass%0A%0A    tu_nodes = list(it)%0A%0A    assert len(tu_nodes) == 3%0A%0A    assert tu_nodes%5B0%5D.kind == CursorKind.STRUCT_DECL%0A    assert tu_nodes%5B0%5D.spelling == 's0'%0A    assert tu_nodes%5B0%5D.is_definition() == True%0A    assert tu_nodes%5B0%5D.location.file.name == 't.c'%0A    assert tu_nodes%5B0%5D.location.line == 4%0A    assert tu_nodes%5B0%5D.location.column == 8%0A%0A    s0_nodes = list(tu_nodes%5B0%5D.get_children())%0A    assert len(s0_nodes) == 2%0A    assert s0_nodes%5B0%5D.kind == CursorKind.FIELD_DECL%0A    assert s0_nodes%5B0%5D.spelling == 'a'%0A    assert s0_nodes%5B1%5D.kind == CursorKind.FIELD_DECL%0A    assert s0_nodes%5B1%5D.spelling == 'b'%0A%0A    assert tu_nodes%5B1%5D.kind == CursorKind.STRUCT_DECL%0A    assert tu_nodes%5B1%5D.spelling == 's1'%0A    assert tu_nodes%5B1%5D.is_definition() == False%0A%0A    assert tu_nodes%5B2%5D.kind == CursorKind.FUNCTION_DECL%0A    assert tu_nodes%5B2%5D.spelling == 'f0'%0A    assert tu_nodes%5B2%5D.is_definition() == True%0A

Add Cursor test.