def test_array_of_numbers(self): m = ast.Module('test') n0 = ast.Number(m, self.fake_span, '42') n1 = ast.Number(m, self.fake_span, '64') a = ast.Array(m, self.fake_span, [n0, n1], False) collector = Collector() cpp_ast_visitor.visit(a, collector) self.assertEqual(collector.visited, [n0, n1, a])
def _make_array(self, exprs: Tuple[ast.Expr, ...]) -> ast.Array: return ast.Array(self.m, self.fake_span, exprs, has_ellipsis=False)