Fixed test environment for escaped test output.
- test-lib uses 'read -r' to parse the test session input literally, without interpretation of backslashes. - FIX: Use quoting to maintain original whitespace (tabs and multiple spaces) from the test session input (instead of condensing into a single space). - Using Bash instead of POSIX shell for t1340-listescapes.sh, so that the interpretation of escape sequences is not dependent on the POSIX shell being used. - Changed Makefile so that the shell selected by the shebang line is actually used when invoking tests, not the POSIX shell. - Above changes obsolete the multiple escaping of the test session data; now, the test session can actually be pasted as-is into a test script, even when it contains backslashes. (I.e. works as expected now.)
This commit is contained in:
@@ -527,7 +527,7 @@ test_todo_session () {
|
||||
cmd=""
|
||||
status=0
|
||||
> expect
|
||||
while read line
|
||||
while read -r line
|
||||
do
|
||||
case $line in
|
||||
">>> "*)
|
||||
@@ -552,7 +552,7 @@ test_todo_session () {
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo $line >> expect
|
||||
echo "$line" >> expect
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user