Beispiel #1
0
def test_typedef_decl():
    typedef = Typedef("test.hpp", "", "MyType", "double")
    exporter = CythonDeclarationExporter(Includes(), Config())
    exporter.visit_typedef(typedef)
    exporter.visit_ast(None)
    decl = exporter.export()
    assert_multi_line_equal(
        decl.strip(),
        lines(
            "cdef extern from \"test.hpp\" namespace \"\":",
            "    ctypedef double MyType"
        )
    )
def test_typedef_decl():
    typedef = Typedef("test.hpp", "", "MyType", "double")
    exporter = CythonDeclarationExporter(Includes(), Config())
    exporter.visit_typedef(typedef)
    exporter.visit_ast(None)
    decl = exporter.export()
    assert_multi_line_equal(
        decl.strip(),
        lines(
            "cdef extern from \"test.hpp\" namespace \"\":",
            "    ctypedef double MyType"
        )
    )