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:
Ingo Karkat
2011-01-20 13:23:06 +01:00
parent a117b7cb3c
commit 2df5f9fee9
3 changed files with 9 additions and 13 deletions

View File

@@ -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