Fix erroneously removing pipe chars from input
cleaninput() unintentionally deletes the '|' character from input. This commit fixes it and adds test for adding tasks with a bunch of symbols.
This commit is contained in:
@@ -58,19 +58,23 @@ TODO: 3 added.
|
|||||||
TODO: 2 of 3 tasks shown
|
TODO: 2 of 3 tasks shown
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_todo_session 'add with &' <<EOF
|
test_todo_session 'add with symbols' <<EOF
|
||||||
>>> todo.sh add "dig the garden & water the flowers"
|
>>> todo.sh add "~@#$%^&*()-_=+[{]}|;:',<.>/?"
|
||||||
4 dig the garden & water the flowers
|
4 ~@#$%^&*()-_=+[{]}|;:',<.>/?
|
||||||
TODO: 4 added.
|
TODO: 4 added.
|
||||||
|
|
||||||
|
>>> todo.sh add '\`!\\"'
|
||||||
|
5 \`!\\"
|
||||||
|
TODO: 5 added.
|
||||||
|
|
||||||
>>> todo.sh list
|
>>> todo.sh list
|
||||||
4 dig the garden & water the flowers
|
|
||||||
1 notice the daisies
|
1 notice the daisies
|
||||||
2 smell the roses
|
2 smell the roses
|
||||||
3 smell the uppercase Roses
|
3 smell the uppercase Roses
|
||||||
|
5 \`!\\"
|
||||||
|
4 ~@#$%^&*()-_=+[{]}|;:',<.>/?
|
||||||
--
|
--
|
||||||
TODO: 4 of 4 tasks shown
|
TODO: 5 of 5 tasks shown
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|||||||
2
todo.sh
2
todo.sh
@@ -260,7 +260,7 @@ cleaninput()
|
|||||||
{
|
{
|
||||||
# Cleanup the input
|
# Cleanup the input
|
||||||
# Replace newlines with spaces Always
|
# Replace newlines with spaces Always
|
||||||
input=`echo $input | tr -d '\r|\n'`
|
input=`echo $input | tr -d '\r\n'`
|
||||||
|
|
||||||
action_regexp="^\(append\|app\|prepend\|prep\|replace\)$"
|
action_regexp="^\(append\|app\|prepend\|prep\|replace\)$"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user