from .util import get_tu
kInput = """\
-// FIXME: Find nicer way to drop builtins and other cruft.
-int start_decl;
-
struct s0 {
int a;
int b;
def test_get_children():
tu = get_tu(kInput)
- # Skip until past start_decl.
it = tu.cursor.get_children()
- while it.next().spelling != 'start_decl':
- pass
-
tu_nodes = list(it)
assert len(tu_nodes) == 3
assert tu_nodes[0].spelling == 's0'
assert tu_nodes[0].is_definition() == True
assert tu_nodes[0].location.file.name == 't.c'
- assert tu_nodes[0].location.line == 4
+ assert tu_nodes[0].location.line == 1
assert tu_nodes[0].location.column == 8
assert tu_nodes[0].hash > 0
assert tu_nodes[0].translation_unit is not None