diff --git a/tests/t1000-addlist.sh b/tests/t1000-addlist.sh index c20d257d..fad3f233 100755 --- a/tests/t1000-addlist.sh +++ b/tests/t1000-addlist.sh @@ -110,17 +110,4 @@ TODO: 1 added. TODO: 1 of 1 tasks shown EOF -echo -n 'this is a first task without newline' > todo.txt -test_todo_session 'add to file without EOL' <>> todo.sh add "a second task" -2 a second task -TODO: 2 added. - ->>> todo.sh list -2 a second task -1 this is a first task without newline --- -TODO: 2 of 2 tasks shown -EOF - test_done diff --git a/tests/t1850-move.sh b/tests/t1850-move.sh deleted file mode 100755 index 9fbdc0b6..00000000 --- a/tests/t1850-move.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash - -test_description='basic move functionality -' -. ./test-lib.sh - -SPACE=' ' - -cat > todo.txt < done.txt <>> todo.sh -f move 1 done.txt | sed "s#'[^']\{1,\}/\([^/']\{1,\}\)'#'\1'#g" -1 (B) smell the uppercase Roses +flowers @outside -TODO: 1 moved from 'todo.txt' to 'done.txt'. - ->>> todo.sh -p ls -2 (A) notice the sunflowers --- -TODO: 1 of 1 tasks shown - ->>> todo.sh -p listfile done.txt -3 (B) smell the uppercase Roses +flowers @outside -1 x 2009-02-13 make the coffee +wakeup -2 x 2009-02-13 smell the coffee +wakeup --- -DONE: 3 of 3 tasks shown -EOF - -cat > todo.txt < done.txt <>> printf y | todo.sh move 1 done.txt 2>&1 | sed -e "s#'[^']\{1,\}/\([^/']\{1,\}\)'#'\1'#g" -e 's#from .\{1,\}/\([^/]\{1,\}\) to .\{1,\}/\([^/]\{1,\}\)?#from \1 to \2?#g' -Move '(B) smell the uppercase Roses +flowers @outside' from todo.txt to done.txt? (y/n)$SPACE -1 (B) smell the uppercase Roses +flowers @outside -TODO: 1 moved from 'todo.txt' to 'done.txt'. - ->>> todo.sh -p ls -2 (A) notice the sunflowers --- -TODO: 1 of 1 tasks shown - ->>> todo.sh -p listfile done.txt -3 (B) smell the uppercase Roses +flowers @outside -1 x 2009-02-13 make the coffee +wakeup -2 x 2009-02-13 smell the coffee +wakeup --- -DONE: 3 of 3 tasks shown -EOF - -test_todo_session 'basic move with passed source' <>> todo.sh -f move 2 todo.txt done.txt | sed "s#'[^']\{1,\}/\([^/']\{1,\}\)'#'\1'#g" -2 x 2009-02-13 smell the coffee +wakeup -TODO: 2 moved from 'done.txt' to 'todo.txt'. - ->>> todo.sh -p ls -2 (A) notice the sunflowers -3 x 2009-02-13 smell the coffee +wakeup --- -TODO: 2 of 2 tasks shown - ->>> todo.sh -p listfile done.txt -3 (B) smell the uppercase Roses +flowers @outside -1 x 2009-02-13 make the coffee +wakeup --- -DONE: 2 of 2 tasks shown -EOF - -echo -n 'this is a first task without newline' > todo.txt -cat > done.txt <>> todo.sh -f move 2 todo.txt done.txt | sed "s#'[^']\{1,\}/\([^/']\{1,\}\)'#'\1'#g" -2 x 2009-02-13 smell the coffee +wakeup -TODO: 2 moved from 'done.txt' to 'todo.txt'. - ->>> todo.sh -p ls -1 this is a first task without newline -2 x 2009-02-13 smell the coffee +wakeup --- -TODO: 2 of 2 tasks shown - ->>> todo.sh -p listfile done.txt -1 x 2009-02-13 make the coffee +wakeup --- -DONE: 1 of 1 tasks shown -EOF - -test_done diff --git a/todo.sh b/todo.sh index fb8d4bce..76b704f1 100755 --- a/todo.sh +++ b/todo.sh @@ -488,12 +488,6 @@ replaceOrPrepend() fi } -fixMissingEndOfLine() -{ - # Parameters: $1: todo file; empty means $TODO_FILE. - sed -i.bak -e '$a\' "${1:-$TODO_FILE}" -} - uppercasePriority() { # Precondition: $input contains task text for which to uppercase priority. @@ -815,7 +809,6 @@ _addto() { input=$(echo -n "($TODOTXT_PRIORITY_ON_ADD) " ; echo "$input") fi fi - fixMissingEndOfLine "$file" echo "$input" >> "$file" if [ "$TODOTXT_VERBOSE" -gt 0 ]; then TASKNUM=$(sed -n '$ =' "$file") @@ -1355,7 +1348,6 @@ case $action in # leave blank line behind (preserves line numbers) sed -i.bak -e "${item}s/^.*//" "$src" fi - fixMissingEndOfLine "$dest" echo "$todo" >> "$dest" if [ "$TODOTXT_VERBOSE" -gt 0 ]; then