def check_error(e, error_message_lines, error_message_head, normalized_error_message_lines):
    for line in normalized_error_message_lines:
        if re.search(expected_error_regex, line):
            return
    pytest.fail(textwrap.dedent('                Expected error {expected_error} but the compiler output did not contain that.\n                Compiler command line: {compiler_command}\n                Error message was:\n                {error_message}\n\n                TMPPy source:\n                {tmppy_source}\n                    \n                TMPPy IR2:\n                {tmppy_ir2}\n                \n                TMPPy IR1:\n                {tmppy_ir1}\n                \n                C++ source:\n                {cxx_source}\n                ').format(expected_error=expected_error_regex, compiler_command=e.command, tmppy_source=add_line_numbers(tmppy_source), tmppy_ir2=str(module_ir2), tmppy_ir1=str(module_ir1), cxx_source=add_line_numbers(cxx_source), error_message=error_message_head), pytrace=False)
def check_error(e, error_message_lines, error_message_head, normalized_error_message_lines):
    for line in normalized_error_message_lines:
        if re.search(expected_error_regex, line):
            return
    pytest.fail(textwrap.dedent('                Expected error {expected_error} but the compiler output did not contain that.\n                Compiler command line: {compiler_command}\n                Error message was:\n                {error_message}\n\n                TMPPy source:\n                {tmppy_source}\n                    \n                TMPPy IR2:\n                {tmppy_ir2}\n                \n                TMPPy IR1:\n                {tmppy_ir1}\n                \n                C++ source:\n                {cxx_source}\n                ').format(expected_error=expected_error_regex, compiler_command=e.command, tmppy_source=add_line_numbers(tmppy_source), tmppy_ir2=str(module_ir2), tmppy_ir1=str(module_ir1), cxx_source=add_line_numbers(cxx_source), error_message=error_message_head), pytrace=False)