Files
todo.txt-cli/tests/t1400-prepend.sh
Paul Mansfield ddaf9ade22 Bug Fix: Issue 6 append and replace unexpected behavior if there's an & in task (even in quotes)
Using the cleaninput function, to escape &'s on certain actions.
Currently the actions needing escaped &'s are append, prepend and replace.
Other actions including add need unescaped &'s.
2009-09-05 20:36:38 +01:00

1.2 KiB
Executable File

#!/bin/sh
 
test_description='basic prepend functionality
'
. ./test-lib.sh
 
test_todo_session 'prepend usage' <<EOF
>>> todo.sh prepend B B
usage: todo.sh prepend ITEM# "TEXT TO PREPEND"
=== 1
EOF
 
cat > todo.txt <<EOF
(B) smell the uppercase Roses +flowers @outside
notice the sunflowers
stop
EOF
test_todo_session 'basic prepend' <<EOF
>>> todo.sh list
1 (B) smell the uppercase Roses +flowers @outside
2 notice the sunflowers
3 stop
--
TODO: 3 of 3 tasks shown from $HOME/todo.txt
 
>>> todo.sh -p list
1 (B) smell the uppercase Roses +flowers @outside
2 notice the sunflowers
3 stop
--
TODO: 3 of 3 tasks shown from $HOME/todo.txt
 
>>> todo.sh prepend 2 test
2: test notice the sunflowers
 
>>> todo.sh -p list
1 (B) smell the uppercase Roses +flowers @outside
3 stop
2 test notice the sunflowers
--
TODO: 3 of 3 tasks shown from $HOME/todo.txt
 
>>> todo.sh prepend 1 test
1: (B) test smell the uppercase Roses +flowers @outside
 
>>> todo.sh -p list
1 (B) test smell the uppercase Roses +flowers @outside
3 stop
2 test notice the sunflowers
--
TODO: 3 of 3 tasks shown from $HOME/todo.txt
 
EOF
 
test_todo_session 'prepend with &' <<EOF
>>> todo.sh prepend 3 "no running & jumping now"
3: no running & jumping now stop
EOF
 
test_done