more test suite changes to partially highlight warning messages; several fixes to bracket expression parsing with equivalence classes, collating symbols, and character classes together with range expressions

This commit is contained in:
Chet Ramey
2025-10-17 15:30:08 -04:00
parent 2a645237d3
commit 6edfd0bf64
33 changed files with 153 additions and 161 deletions
+8
View File
@@ -10,6 +10,14 @@ export TMPDIR
export BASH_TSTOUT=/tmp/xx
rm -f ${BASH_TSTOUT}
# keep track of passed and failed tests and report them
if [ -t 1 ]; then
# can't rely on having $'...' or printf understanding \e
# bright red background, white foreground text
export CSTART=$(printf '\033[01;101;37m') CEND=$(printf '\033[0m')
else
export CSTART= CEND=
fi
export TAB=' '
${THIS_SH} "$@"
+1 -1
View File
@@ -20,7 +20,7 @@ intmax_min2=$((-2**63))
case $intmax_max in
9223372036854775807) ;;
*) echo "warning: your machine does not support 64-bit arithmetic using intmax_t" 2>&1 ;;
*) echo "${CSTART}warning${CEND}: your machine does not support 64-bit arithmetic using intmax_t" 2>&1 ;;
esac
# these are actually the same
+4
View File
@@ -0,0 +1,4 @@
for f ; do
echo $f
sed 's|warning:|${CSTART}warning${CEND}:|' < $f > zzz && mv zzz $f
done
+2 -2
View File
@@ -15,8 +15,8 @@
# this locale causes problems all over the place
if [ -z "$ZH_LOCALE" ]; then
echo "glob2.sub: warning: you do not have the zh_TW.big5 locale installed;" >&2
echo "glob2.sub: warning: that may cause some of these tests to fail." >&2
echo "${CSTART}glob2.sub: warning${CEND}: you do not have the zh_TW.big5 locale installed;" >&2
echo "${TAB}glob2.sub: that may cause some of these tests to fail." >&2
ZH_LOCALE=$ZH_DEFAULT
fi
+2 -2
View File
@@ -16,8 +16,8 @@ unset LC_ALL LC_NUMERIC
if locale -a | grep -i '^de_DE\.UTF.*8' >/dev/null ; then
export LANG=de_DE.UTF-8
else
echo "intl2.sub: warning: you do not have the de_DE.UTF-8 locale installed;" >&2
echo "intl2.sub: that will cause some of these tests to fail." >&2
echo "${CSTART}intl2.sub: warning${CEND}: you do not have the de_DE.UTF-8 locale installed;" >&2
echo "${TAB}intl2.sub: that will cause some of these tests to fail." >&2
fi
printf '%.4f\n' 1
+1
View File
@@ -68,6 +68,7 @@ if [ -t 1 ]; then
else
CSTART= CEND=
fi
export CSTART CEND
passed=0
total=0
+2 -2
View File
@@ -1,6 +1,6 @@
echo "warning: all of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell" >&2
echo "warning: the BASH_ARGC and BASH_ARGV tests will fail if debugging" >&2
echo "${CSTART}warning${CEND}: the BASH_ARGC and BASH_ARGV tests will fail if debugging" >&2
echo "${TAB}support has not been compiled into the shell" >&2
${THIS_SH} ./array.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} array.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: all of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell" >&2
${THIS_SH} ./array-at-star > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} array2.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: all of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell" >&2
${THIS_SH} ./assoc.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} assoc.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: some of these tests may fail if process substitution has not" >&2
echo "${CSTART}warning${CEND}: some of these tests may fail if process substitution has not" >&2
echo "${TAB}been compiled into the shell or if the OS does not provide" >&2
echo "${TAB}/dev/fd." >&2
+3 -3
View File
@@ -1,8 +1,8 @@
echo "warning: all of these tests will fail if the conditional command has not" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if the conditional command has not" >&2
echo "${TAB}been compiled into the shell" >&2
echo "warning: some of these tests will fail if extended pattern matching has not" >&2
echo "${CSTART}warning${CEND}: some of these tests will fail if extended pattern matching has not" >&2
echo "${TAB}been compiled into the shell" >&2
echo "warning: the text of system error messages may vary between systems and" >&2
echo "${CSTART}warning${CEND}: the text of system error messages may vary between systems and" >&2
echo "${TAB}produce diff output." >&2
${THIS_SH} ./cond.tests > ${BASH_TSTOUT} 2>&1
+2 -2
View File
@@ -12,12 +12,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
echo "warning: the text of a system error message may vary between systems and" >&2
echo "${CSTART}warning${CEND}: the text of a system error message may vary between systems and" >&2
echo "${TAB}produce diff output." >&2
echo "${TAB}if the text of the error messages concerning \`notthere' or" >&2
echo "${TAB}\`/tmp/bash-notthere' not being found or \`/' being a directory" >&2
echo "${TAB}produce diff output, please do not consider this a test failure" >&2
echo "warning: if diff output differing only in the location of the bash" >&2
echo "${CSTART}warning${CEND}: if diff output differing only in the location of the bash" >&2
echo "${TAB}binary appears, please do not consider this a test failure" >&2
${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: if you have exported functions defined in your environment," >&2
echo "${CSTART}warning${CEND}: if you have exported functions defined in your environment," >&2
echo "${TAB}they may show up as diff output." >&2
echo "${TAB}If so, please do not consider this a test failure" >&2
${THIS_SH} ./func.tests > ${BASH_TSTOUT} 2>&1
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: UNIX versions number signals and schedule processes differently." >&2
echo "${CSTART}warning${CEND}: UNIX versions number signals and schedule processes differently." >&2
echo "${TAB}If output differing only in line numbers is produced, please" >&2
echo "${TAB}do not consider this a test failure." >&2
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: all of these tests will fail if history has not been compiled" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if history has not been compiled" >&2
echo "${TAB}into the shell" >&2
${THIS_SH} ./histexp.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} histexp.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: all of these tests will fail if history has not been compiled" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if history has not been compiled" >&2
echo "${TAB}into the shell" >&2
${THIS_SH} ./history.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} history.right && rm -f ${BASH_TSTOUT}
+2 -2
View File
@@ -1,6 +1,6 @@
echo "warning: some of these tests may fail if job control has not been compiled" >&2
echo "${CSTART}warning${CEND}: some of these tests may fail if job control has not been compiled" >&2
echo "${TAB}into the shell" >&2
echo "warning: there may be a message regarding a cat process dying due to a" >&2
echo "${CSTART}warning${CEND}: there may be a message regarding a cat process dying due to a" >&2
echo "${TAB}SIGHUP. Please disregard." >&2
${THIS_SH} ./jobs.tests > ${BASH_TSTOUT} 2>&1
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: some of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: some of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell" >&2
${THIS_SH} ./nameref.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} nameref.right && rm -f ${BASH_TSTOUT}
+2 -2
View File
@@ -1,8 +1,8 @@
echo "warning: two of these tests will fail if your OS does not support" >&2
echo "${CSTART}warning${CEND}: two of these tests will fail if your OS does not support" >&2
echo "${TAB}named pipes or the /dev/fd filesystem. If the tests of the" >&2
echo "${TAB}process substitution mechanism fail, please do not consider" >&2
echo "${TAB}this a test failure" >&2
echo "warning: if you have exported variables beginning with the string _Q," >&2
echo "${CSTART}warning${CEND}: if you have exported variables beginning with the string _Q," >&2
echo "${TAB}the tests may generate diff output. If so, please do not consider" >&2
echo "${TAB}this a test failure" >&2
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: several of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: several of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell." >&2
${THIS_SH} ./nquote1.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
diff ${BASH_TSTOUT} nquote1.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: several of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: several of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell." >&2
${THIS_SH} ./nquote2.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
diff ${BASH_TSTOUT} nquote2.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: several of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: several of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell." >&2
${THIS_SH} ./nquote3.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
diff ${BASH_TSTOUT} nquote3.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,7 +1,7 @@
# See whether or not we can use `diff -a'
( diff -a ./nquote4.right ./nquote4.right >/dev/null 2>&1 ) && AFLAG=-a
echo "warning: some of these tests will fail if you do not have UTF-8" >&2
echo "${CSTART}warning${CEND}: some of these tests will fail if you do not have UTF-8" >&2
echo "${TAB}locales installed on your system" >&2
${THIS_SH} ./nquote4.tests > ${BASH_TSTOUT} 2>&1
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: all of these tests will fail if process substitution has not" >&2
echo "${CSTART}warning${CEND}: all of these tests will fail if process substitution has not" >&2
echo "${TAB}been compiled into the shell or if the OS does not provide" >&2
echo "${TAB}FIFOs or /dev/fd. Some tests may fail if the OS does not" >&2
echo "${TAB}provide FIFOs." >&2
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: please do not consider output differing only in the amount of" >&2
echo "${CSTART}warning${CEND}: please do not consider output differing only in the amount of" >&2
echo "${TAB}white space to be an error." >&2
${THIS_SH} ./read.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} read.right && rm -f ${BASH_TSTOUT}
+2 -2
View File
@@ -1,6 +1,6 @@
echo "warning: the text of a system error message may vary between systems and" >&2
echo "${CSTART}warning${CEND}: the text of a system error message may vary between systems and" >&2
echo "${TAB}produce diff output." >&2
echo "warning: if the text of an error message concerning \`redir1.*' not being" >&2
echo "${CSTART}warning${CEND}: if the text of an error message concerning \`redir1.*' not being" >&2
echo "${TAB}found or messages concerning bad file descriptors produce diff" >&2
echo "${TAB}output, please do not consider it a test failure" >&2
${THIS_SH} ./redir.tests > ${BASH_TSTOUT} 2>&1
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: UNIX versions number signals and schedule processes differently." >&2
echo "${CSTART}warning${CEND}: UNIX versions number signals and schedule processes differently." >&2
echo "${TAB}If output differing only in line numbers is produced, please" >&2
echo "${TAB}do not consider this a test failure." >&2
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: some of these tests will fail if arrays have not" >&2
echo "${CSTART}warning${CEND}: some of these tests will fail if arrays have not" >&2
echo "${TAB}been compiled into the shell" >&2
${THIS_SH} ./varenv.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
diff ${BASH_TSTOUT} varenv.right && rm -f ${BASH_TSTOUT}
+1 -1
View File
@@ -1,4 +1,4 @@
echo "warning: the text of a system error message may vary between systems and" >&2
echo "${CSTART}warning${CEND}: the text of a system error message may vary between systems and" >&2
echo "${TAB}produce diff output." >&2
${THIS_SH} ./vredir.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} vredir.right && rm -f ${BASH_TSTOUT}
+2 -2
View File
@@ -23,8 +23,8 @@ TestCnt=0
localewarn()
{
echo "unicode1.sub: warning: you do not have the $1 locale installed;" >&2
echo "unicode1.sub: that will cause some of these tests to be skipped." >&2
echo "${CSTART}unicode1.sub: warning${CEND}: you do not have the $1 locale installed;" >&2
echo "${TAB}that will cause some of these tests to be skipped." >&2
}
function TestCodePage {