def eval(f):

    @wraps(f)
    def wrapper():
        tmppy_source = _get_function_body(f)
        (module_ir2, module_ir1, cpp_source) = _convert_to_cpp_expecting_success(tmppy_source)
        assert (expected_cpp_source[0] == '\n')
        if (cpp_source != expected_cpp_source[1:]):
            pytest.fail(textwrap.dedent("                        The generated code didn't match the expected code.\n                        \n                        TMPPy source:\n                        {tmppy_source}\n                        \n                        TMPPy IR2:\n                        {tmppy_ir2}\n                        \n                        TMPPy IR1:\n                        {tmppy_ir1}\n                        \n                        Generated C++ source:\n                        {cpp_source}\n                        \n                        Expected C++ source:\n                        {expected_cpp_source}\n                        \n                        Diff:\n                        {cpp_source_diff}\n                        ").format(tmppy_source=add_line_numbers(tmppy_source), tmppy_ir2=str(module_ir2), tmppy_ir1=str(module_ir1), cpp_source=str(cpp_source), expected_cpp_source=str(expected_cpp_source[1:]), cpp_source_diff=''.join(difflib.unified_diff(expected_cpp_source[1:].splitlines(True), cpp_source.splitlines(True), fromfile='expected.h', tofile='actual.h'))), pytrace=False)
    return wrapper
def eval(f):

    @wraps(f)
    def wrapper():
        tmppy_source = _get_function_body(f)
        (module_ir2, module_ir1, cpp_source) = _convert_to_cpp_expecting_success(tmppy_source)
        assert (expected_cpp_source[0] == '\n')
        if (cpp_source != expected_cpp_source[1:]):
            pytest.fail(textwrap.dedent("                        The generated code didn't match the expected code.\n                        \n                        TMPPy source:\n                        {tmppy_source}\n                        \n                        TMPPy IR2:\n                        {tmppy_ir2}\n                        \n                        TMPPy IR1:\n                        {tmppy_ir1}\n                        \n                        Generated C++ source:\n                        {cpp_source}\n                        \n                        Expected C++ source:\n                        {expected_cpp_source}\n                        \n                        Diff:\n                        {cpp_source_diff}\n                        ").format(tmppy_source=add_line_numbers(tmppy_source), tmppy_ir2=str(module_ir2), tmppy_ir1=str(module_ir1), cpp_source=str(cpp_source), expected_cpp_source=str(expected_cpp_source[1:]), cpp_source_diff=.join(difflib.unified_diff(expected_cpp_source[1:].splitlines(True), cpp_source.splitlines(True), fromfile='expected.h', tofile='actual.h'))), pytrace=False)
    return wrapper