BUG: Multiple whitespace was condensed, CR/LF not turned to space.

Missing quoting inside cleaninput() condensed multiple subsequent spaces into a single space, even when the user took pains to preserve whitespace by properly quoting the task in the shell.
The 'tr' command completely removed CR and LF characters instead of replacing them with a single space.
Add test cases for the whitespace handling to the add, append, prepend and replace actions.
This commit is contained in:
Ingo Karkat
2011-05-31 16:41:21 +02:00
parent 0e3c8eb29b
commit 3134e8f51a
5 changed files with 54 additions and 1 deletions

View File

@@ -89,6 +89,14 @@ TODO: Replaced task with:
1 thrash the hay & thrash the wheat
EOF
echo 'jump on hay' > todo.txt
test_todo_session 'replace with spaces' <<EOF
>>> todo.sh replace 1 "notice the three spaces"
1 jump on hay
TODO: Replaced task with:
1 notice the three spaces
EOF
cat > todo.txt <<EOF
smell the cows
grow some corn