# Path: luna/tests/helpers.py
# def codetest(src):
#     f = luabytecode_file(src)
#     flags, protos = Parser(f.name).parse()
#     interpreter = Interpreter(flags, protos)
#     ret = interpreter.run()
#     return ret
# 
# def test_file(src='', suffix=''):
#     f = tempfile.NamedTemporaryFile(suffix=suffix)
#     f.write(src)
#     f.flush()
#     return f


import pytest
from ..helpers import codetest, test_file

    def test_assert_false_with_or(self):
            with pytest.raises(AssertionError):
                codetest("""
                            assert(false or false)
                        """)

    def test_assert_true_1(self):
        codetest("""
                    assert(1)
                """)

    def test_assert_true_with_vars_lt(self):
            codetest("""
                        x = 100
                        y = 10
                        assert(y < x)
                    """)

    def test_assert_true_with_and(self):
            codetest("""
                        assert(true and true)
                    """)

    def test_assert_true_with_or(self):
            codetest("""
                        assert(false or true)
                    """)

    def test_loadfile_simple(self):

# Path: luna/tests/helpers.py
# def codetest(src):
#     f = luabytecode_file(src)
#     flags, protos = Parser(f.name).parse()
#     interpreter = Interpreter(flags, protos)
#     ret = interpreter.run()
#     return ret
# 
# def test_file(src='', suffix=''):
#     f = tempfile.NamedTemporaryFile(suffix=suffix)
#     f.write(src)
#     f.flush()
#     return f


# Path: luna/tests/modules/test_builtin.py
import pytest
from ..helpers import codetest, test_file


    def test_assert_false_with_or(self):
            with pytest.raises(AssertionError):
                codetest("""
                            assert(false or false)
                        """)

    def test_assert_true_1(self):
        codetest("""
                    assert(1)
                """)

    def test_assert_true_with_vars_lt(self):
            codetest("""
                        x = 100
                        y = 10
                        assert(y < x)
                    """)

    def test_assert_true_with_and(self):
            codetest("""
                        assert(true and true)
                    """)

    def test_assert_true_with_or(self):
            codetest("""
                        assert(false or true)
                    """)

    def test_loadfile_simple(self):

        f = test_file(src='return "test"')