Bug Fix, better fix for "add does not escape line breaks"

Now removes windows and unix style line breaks. Each test has a windows
and a unix style line break.
This commit is contained in:
Paul Mansfield
2009-09-04 12:23:48 +01:00
parent 229737bd2f
commit f44bcfb067
2 changed files with 13 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ test_description='Multi-line functionality'
# Create the expected file
echo "1: smell the cheese
replaced with
1: eat apples eat oranges">$HOME/expect.multi
1: eat apples eat oranges drink milk">$HOME/expect.multi
test_expect_success 'multiline item replace' '
(
@@ -18,7 +18,8 @@ cat /dev/null > $HOME/todo.txt
# Run replace
"$HOME/bin/todo.sh" replace 1 "eat apples
eat oranges" > $HOME/output.multi
eat oranges
drink milk" > $HOME/output.multi
# Test output against expected
diff "$HOME/output.multi" "$HOME/expect.multi"
@@ -32,7 +33,7 @@ fi
## Add test
# Create the expected file
echo "TODO: 'eat apples eat oranges' added on line 2.">$HOME/expect.multi
echo "TODO: 'eat apples eat oranges drink milk' added on line 2.">$HOME/expect.multi
test_expect_success 'multiline item add' '
(
@@ -42,7 +43,8 @@ cat /dev/null > $HOME/todo.txt
# Run add
"$HOME/bin/todo.sh" add "eat apples
eat oranges" > $HOME/output.multi
eat oranges
drink milk" > $HOME/output.multi
# Test output against expected
diff "$HOME/output.multi" "$HOME/expect.multi"
@@ -56,7 +58,7 @@ fi
## Append test
# Create the expected file
echo "1: smell the cheese eat apples eat oranges">$HOME/expect.multi
echo "1: smell the cheese eat apples eat oranges drink milk">$HOME/expect.multi
test_expect_success 'multiline item append' '
(
@@ -66,7 +68,8 @@ cat /dev/null > $HOME/todo.txt
# Run append
"$HOME/bin/todo.sh" append 1 "eat apples
eat oranges" > $HOME/output.multi
eat oranges
drink milk" > $HOME/output.multi
# Test output against expected
diff "$HOME/output.multi" "$HOME/expect.multi"
@@ -80,7 +83,7 @@ fi
## Prepend test
# Create the expected file
echo "1: eat apples eat oranges smell the cheese">$HOME/expect.multi
echo "1: eat apples eat oranges drink milk smell the cheese">$HOME/expect.multi
test_expect_success 'multiline item prepend' '
(
@@ -90,7 +93,8 @@ cat /dev/null > $HOME/todo.txt
# Run prepend
"$HOME/bin/todo.sh" prepend 1 "eat apples
eat oranges" > $HOME/output.multi
eat oranges
drink milk" > $HOME/output.multi
# Test output against expected
diff "$HOME/output.multi" "$HOME/expect.multi"

View File

@@ -244,7 +244,7 @@ cleaninput()
{
# Cleanup the input
# Replace newlines with spaces
input=`echo $input | tr -d '\n'`
input=`echo $input | tr -d '\r|\n'`
}
archive()