<gh_stars>0
import pytest

from ..errors import WormError
from ..transformer import hook

hook(debug=False)


def test_no_inference():
    from .no_inference import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_minimal_type_inference():
    from .minimal_type_inference import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_declare_func():
    from .decl import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_return():
    from .infer_return import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_void():
    from .infer_void import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_hygienic():
    from .hygienic import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_late_inference():
    from .late_inference import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_on_return():
    from .infer_on_return import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_fib():
    from .fib import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_type_check():
    from .typed import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_struct():
    from .struct import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_on_assign():
    from .infer_on_assign import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_struct_literal():
    from .struct_literal import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_rect():
    from .rect import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_arg_type():
    from .arg_type import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_point_to_error():
    from .constant_error import prog, __doc__

    with pytest.raises(WormError) as e:
        prog.dump_source()
    print(e.value)
    assert "At L" in e.value.args[0]


def test_sq_macro():
    from .sq_macro import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_not_worm():
    from .not_worm import fs, __doc__
    assert __doc__ == fs.getvalue()


# def test_quote():
#     from .quote import prog, __doc__
#     assert prog.dump_source() == __doc__


if __name__ == "__main__":
    import pytest

    pytest.main([__file__])

import pytest

from ..errors import WormError
from ..transformer import hook

hook(debug=False)


def test_no_inference():
    from .no_inference import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_minimal_type_inference():
    from .minimal_type_inference import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_declare_func():
    from .decl import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_return():
    from .infer_return import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_void():
    from .infer_void import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_hygienic():
    from .hygienic import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_late_inference():
    from .late_inference import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_on_return():
    from .infer_on_return import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_fib():
    from .fib import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_type_check():
    from .typed import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_struct():
    from .struct import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_infer_on_assign():
    from .infer_on_assign import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_struct_literal():
    from .struct_literal import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_rect():
    from .rect import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_arg_type():
    from .arg_type import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_point_to_error():
    from .constant_error import prog, __doc__

    with pytest.raises(WormError) as e:
        prog.dump_source()
    print(e.value)
    assert "At L" in e.value.args[0]


def test_sq_macro():
    from .sq_macro import prog, __doc__

    assert __doc__ == prog.dump_source()


def test_not_worm():
    from .not_worm import fs, __doc__
    assert __doc__ == fs.getvalue()


# def test_quote():
#     from .quote import prog, __doc__
#     assert prog.dump_source() == __doc__


if __name__ == "__main__":
    import pytest

    pytest.main([__file__])
# def test_quote(): #     from .quote import prog, __doc__ #     assert prog.dump_source() == __doc__