"""Test programs generated by a compiler for the Tiger language implemented for CS350.
"""
from hera.main import main


def test_div_and_print(capsys):
    main(["test/assets/cs350/div_and_print.hera"])

    captured = capsys.readouterr()
    assert captured.out == "5"


def test_merge_sort(capsys):
    main(["test/assets/cs350/merge_sort.hera"])

    captured = capsys.readouterr()
    assert captured.out == "42"


def test_lexical_scope_deep(capsys):
    main(["test/assets/cs350/lexical_scope_deep.hera"])

    captured = capsys.readouterr()
    assert captured.out == "42"
