ref: 645e9c390a67978953f8067e46d03d4e25c8453e
parent: 0d4f55130681433da88fd5334149c6a60619cec1
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Mar 22 04:23:35 EDT 2017
[tests] Don't quote what doesn't need to be quoted Quoting $chk was passing the file name "/tmp/something" to diff, instead of the correct /tmp/something. Quotoing $chk was totally unneded because it is a name generated by the own script, so it is known to be correct. In the same way $i is totally controlled by scc, so it is known to be correct.
--- a/tests/error/chktest.sh
+++ b/tests/error/chktest.sh
@@ -11,11 +11,10 @@
while read i state
do
echo $i >> test.log
- printf "%s\t" "$i"
- printf "%s" "$state"
+ printf "%s\t%s" $i $state
- scc $CFLAGS -w -c "$i" 2> $err
- echo "/^PATTERN/+;/^\./-w \"$chk\"" | ed -s "$i"
- diff -c "$chk" "$err" >> test.log && echo [OK] || echo [FAILED]
+ scc $CFLAGS -w -c $i 2> $err
+ echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i
+ diff -c $chk $err >> test.log && echo [OK] || echo [FAILED]
rm -f *.o
done