minor change in test driver
This commit is contained in:
@ -15,7 +15,7 @@ while(i < 20) {
|
||||
|
||||
---
|
||||
|
||||
if ##ERROR: syntax error - no conditional expression after if
|
||||
if ##ERROR: syntax error - no conditional expression after 'if'
|
||||
|
||||
---
|
||||
|
||||
|
17
t/err.sh
17
t/err.sh
@ -27,14 +27,19 @@ run_partfile() {
|
||||
return 1
|
||||
}
|
||||
|
||||
l_expected_errline=$(echo $l_expected_errinfo | cut -d: -f1)
|
||||
l_xlen=$(echo $l_expected_errline | wc -c)
|
||||
l_expected_errline=$(echo "$l_expected_errinfo" | cut -d: -f1)
|
||||
l_xlen=$(echo "$l_expected_errline" | wc -c)
|
||||
l_xlen=$(expr $l_xlen + 10)
|
||||
l_expected_errmsg=$(echo $l_expected_errinfo | cut -c${l_xlen}-)
|
||||
l_expected_errmsg=$(echo "$l_expected_errinfo" | cut -c${l_xlen}-)
|
||||
l_output=`$l_cmd 2>&1`
|
||||
## the regular expression is not escaped properly. the error information must not
|
||||
## include specifial regex characters to avoid problems.
|
||||
echo "$l_output" | grep -E "ERROR:.+${l_partfile}\[${l_expected_errline},[[:digit:]]+\] ${l_expected_errmsg}" >/dev/null 2>&1 || {
|
||||
|
||||
## the checks using grep may not be 100% accurate depending on message patterns.
|
||||
## but it's unlikely such a case really happens
|
||||
echo "$l_output" | grep -q -E "^ERROR:.+${l_partfile}\[${l_expected_errline},[[:digit:]]+\] .+" 2>&1 || {
|
||||
echo "ERROR: error not raised at line $l_expected_errline - $l_script($l_partno) - $l_output"
|
||||
return 1
|
||||
}
|
||||
echo "$l_output" | grep -q -F " ${l_expected_errmsg}" 2>&1 || {
|
||||
echo "ERROR: error not raised at line $l_expected_errline - $l_script($l_partno) - $l_output"
|
||||
return 1
|
||||
}
|
||||
|
@ -49,5 +49,5 @@ class A [ a + ] { ##ERROR: syntax error - prohibited binary operator - +
|
||||
|
||||
## TODO: This check is supposed to fail. + must be treated as a binop symbol
|
||||
##---
|
||||
##class A [ + ] { ##ERROR: syntax error - prohibited binary operator - +
|
||||
##class A [ + ] { ## ERROR: syntax error - prohibited binary operator - +
|
||||
##}
|
||||
|
Reference in New Issue
Block a user