# Path: nolang/main.py
# def main(argv):
#     if len(argv) != 2:
#         print __doc__
#         return 1
#     return run_code(argv[1])


import re
from support import reformat_code
from nolang.main import main




class TestMain(object):
    def test_main(self, tmpdir):
        fname = tmpdir.join("foo.q")
        fname.write(reformat_code("""
        def main() {
            print(3);
        }
        """))

# Path: nolang/main.py
# def main(argv):
#     if len(argv) != 2:
#         print __doc__
#         return 1
#     return run_code(argv[1])


# Path: tests/test_main.py
import re
from support import reformat_code
from nolang.main import main





class TestMain(object):
    def test_main(self, tmpdir):
        fname = tmpdir.join("foo.q")
        fname.write(reformat_code("""
        def main() {
            print(3);
        }
        """))

        assert main(['nolang-c', str(fname)]) == 0