t9500: Add test for handling incomplete lines in diff by gitweb

Check that "commitdiff" action in gitweb can handle (without errors)
incomplete lines as added and removed lines, and as context lines.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jakub Narebski 2011-10-31 00:36:24 +01:00 коммит произвёл Junio C Hamano
Родитель 970fac5e24
Коммит e4bd10b2cd
1 изменённых файлов: 47 добавлений и 0 удалений

Просмотреть файл

@ -273,6 +273,53 @@ test_expect_success \
'commitdiff(2): directory becomes symlink' \
'gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=foo-symlinked-to-bar"'
# ----------------------------------------------------------------------
# commitdiff testing (incomplete lines)
test_expect_success 'setup incomplete lines' '
cat >file<<-\EOF &&
Dominus regit me,
et nihil mihi deerit.
In loco pascuae ibi me collocavit,
super aquam refectionis educavit me;
animam meam convertit,
deduxit me super semitas jusitiae,
propter nomen suum.
CHANGE_ME
EOF
git commit -a -m "Preparing for incomplete lines" &&
echo "incomplete" | tr -d "\\012" >>file &&
git commit -a -m "Add incomplete line" &&
git tag incomplete_lines_add &&
sed -e s/CHANGE_ME/change_me/ <file >file+ &&
mv -f file+ file &&
git commit -a -m "Incomplete context line" &&
git tag incomplete_lines_ctx &&
echo "Dominus regit me," >file &&
echo "incomplete line" | tr -d "\\012" >>file &&
git commit -a -m "Change incomplete line" &&
git tag incomplete_lines_chg
echo "Dominus regit me," >file &&
git commit -a -m "Remove incomplete line" &&
git tag incomplete_lines_rem
'
test_expect_success 'commitdiff(1): addition of incomplete line' '
gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add"
'
test_expect_success 'commitdiff(1): incomplete line as context line' '
gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx"
'
test_expect_success 'commitdiff(1): change incomplete line' '
gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg"
'
test_expect_success 'commitdiff(1): removal of incomplete line' '
gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem"
'
# ----------------------------------------------------------------------
# commit, commitdiff: merge, large
test_expect_success \