File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed
Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,11 @@ echo >perfect '> 0
4141echo > ok ' 0'
4242echo ' 0' | prog > effective
4343
44- if diff perfect effective > /dev/null 2>&1 ; then
44+ echo " checking for readline output"
45+ if diff perfect effective; then
4546 # Alles ist gut.
4647 strip_prompt=false
47- elif diff ok effective > /dev/null 2>&1 ; then
48+ elif diff ok effective; then
4849 strip_prompt=true
4950else
5051 skip " this is not the GNU Readline we expect"
@@ -257,14 +258,22 @@ err: Cleanup: popping nterm input (1.1-4: )' -p
257258# From now on, the differences between versions of GNU Readline are
258259# too painful to try to cope with.
259260if $strip_prompt ; then
260- echo " SKIP: this is not the GNU Readline we expect"
261- if $exit ; then
262- exit 0
263- else
264- exit 1
265- fi
261+ echo " SKIP: this is not the GNU Readline we expect"
262+ exit $status
266263fi
267264
265+ # On Windows10/MSYS2 the ^G coming from <tab> completion is not
266+ # emitted the same way
267+ # (https://lists.gnu.org/r/bug-bison/2020-05/msg00076.html).
268+ echo " checking for kernel name"
269+ case ` uname -s` in
270+ (MSYS* )
271+ echo " SKIP: this is Windows/MSYS"
272+ exit $status
273+ ;;
274+ esac
275+
276+
268277# Check completion after an operator.
269278sed -e ' s/\\t/ /g' > input << EOF
270279(1+\t\t
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ cwd=$(pwd)
3434# See bistromathic.test.
3535strip_prompt=false
3636
37+ # If diff supports --strip-trailing-cr, use it, to avoid EOL issues
38+ # when testing Java programs on Windows.
39+ echo " checking for diff --strip-trailing-cr"
40+ if diff --strip-trailing-cr " $1 " " $1 " ; then
41+ diff_opts=--strip-trailing-cr
42+ fi
43+
3744# The exercised program.
3845abs_medir=$cwd /examples/$medir
3946if test -x " $abs_medir /$me " ; then
@@ -129,7 +136,7 @@ run ()
129136 } > eff
130137
131138 if test $sta_eff -eq $sta_exp ; then
132- if diff eff exp > /dev/null 2>&1 ; then
139+ if diff $diff_opts eff exp > /dev/null 2>&1 ; then
133140 echo " $me : PASS: $number "
134141 else
135142 echo " $me : FAIL: $number "
@@ -140,7 +147,7 @@ run ()
140147 echo " $me : effective output:"
141148 sed -e ' s/^/ /' eff
142149 echo " $me : diff:"
143- diff -u exp eff | sed -e ' s/^/ /'
150+ diff $diff_opts -u exp eff | sed -e ' s/^/ /'
144151 status=1
145152 fi
146153 else
You can’t perform that action at this time.
0 commit comments