diff --git a/fprettify/__init__.py b/fprettify/__init__.py index d01e89d6..a0d08262 100644 --- a/fprettify/__init__.py +++ b/fprettify/__init__.py @@ -269,7 +269,7 @@ def split(self, line): LR_OPS_RE = [REL_OP_RE, LOG_OP_RE, plusminus_parser(PLUSMINUS_RE), MULTDIV_RE, PRINT_RE] USE_RE = re.compile( - SOL_STR + "USE(\s+|(,.+?)?::\s*)\w+?((,.+?=>.+?)+|,\s*only\s*:.+?)?$" + EOL_STR, RE_FLAGS) + SOL_STR + r"USE(\s+|(,.+?)?::\s*)\w+?((,.+?=>.+?)+|,\s*only\s*:.+?)?$" + EOL_STR, RE_FLAGS) # markups to deactivate formatter NO_ALIGN_RE = re.compile(SOL_STR + r"&\s*[^\s*]+") diff --git a/tests/TERAPI-FAILS/ABIN_ERROR4.ref b/tests/TERAPI-FAILS/ABIN_ERROR4.ref index 1a75b0fb..b6c13d04 100644 --- a/tests/TERAPI-FAILS/ABIN_ERROR4.ref +++ b/tests/TERAPI-FAILS/ABIN_ERROR4.ref @@ -1 +1 @@ -ERROR in mpi_wrapper.F90: Message truncated, error stack: +ERROR in mpi_wrapper.F90: diff --git a/tests/TERAPI-FAILS/test4.sh b/tests/TERAPI-FAILS/test4.sh index 3729b7b5..eda3596a 100755 --- a/tests/TERAPI-FAILS/test4.sh +++ b/tests/TERAPI-FAILS/test4.sh @@ -12,7 +12,9 @@ function cleanup { kill -9 $tcpid $abinpid > /dev/null 2>&1 || true grep 'what()' $TCOUT > TC_ERROR$IDX if [[ -f ERROR ]];then - mv ERROR ABIN_ERROR$IDX + # NOTE: Different compilers may print different errors here, + # so we strip the actual error and just check that it came from mpi_wrapper.F90 + sed -E 's/(ERROR in mpi_wrapper.F90:).*/\1/' ERROR > ABIN_ERROR$IDX fi exit 0 }