Ejemplo n.º 1
0
    def method_has_body(self):
        node = cs.method("f", [], [cs.ret(cs.ref("x"))])
        expected = """internal dynamic f() {
    return x;
}
"""
        assert_equal(expected, cs.dumps(node))
Ejemplo n.º 2
0
    def class_body_is_written_out(self):
        node = cs.class_("A", [cs.method("Main", [], [])])
        expected = """internal class A {
    internal dynamic Main() {
    }
}
"""
        assert_equal(expected, cs.dumps(node))
Ejemplo n.º 3
0
    def method_can_be_set_as_ststic(self):
        node = cs.method("f", [], [], static=True)
        expected = """internal static dynamic f() {
}
"""
        assert_equal(expected, cs.dumps(node))
Ejemplo n.º 4
0
    def method_return_type_can_be_overridden(self):
        node = cs.method("f", [], [], returns=cs.void)
        expected = """internal void f() {
}
"""
        assert_equal(expected, cs.dumps(node))
Ejemplo n.º 5
0
    def method_has_dynamic_arguments(self):
        node = cs.method("f", [cs.arg("x"), cs.arg("y")], [])
        expected = """internal dynamic f(dynamic x, dynamic y) {
}
"""
        assert_equal(expected, cs.dumps(node))
Ejemplo n.º 6
0
    def method_has_internal_visibility(self):
        node = cs.method("f", [], [])
        expected = """internal dynamic f() {
}
"""
        assert_equal(expected, cs.dumps(node))