Skip to content

Commit

Permalink
whitespace: tests for git-diff --check with tab-in-indent error class
Browse files Browse the repository at this point in the history
[jc: with test fixes from J6t]

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Chris Webb authored and Junio C Hamano committed Apr 4, 2010
1 parent 3e3ec2a commit b27eb49
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions t/t4015-diff-whitespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,48 @@ test_expect_success 'check tabs and spaces as indentation (indent-with-non-tab:
'

test_expect_success 'check tabs as indentation (tab-in-indent: off)' '
git config core.whitespace "-tab-in-indent" &&
echo " foo ();" > x &&
git diff --check
'

test_expect_success 'check tabs as indentation (tab-in-indent: on)' '
git config core.whitespace "tab-in-indent" &&
echo " foo ();" > x &&
test_must_fail git diff --check
'

test_expect_success 'check tabs and spaces as indentation (tab-in-indent: on)' '
git config core.whitespace "tab-in-indent" &&
echo " foo ();" > x &&
test_must_fail git diff --check
'

test_expect_success 'check tab-in-indent and indent-with-non-tab conflict' '
git config core.whitespace "tab-in-indent,indent-with-non-tab" &&
echo "foo ();" > x &&
test_must_fail git diff --check
'

test_expect_success 'check tab-in-indent excluded from wildcard whitespace attribute' '
git config --unset core.whitespace &&
echo "x whitespace" > .gitattributes &&
echo " foo ();" > x &&
git diff --check &&
rm -f .gitattributes
'

test_expect_success 'line numbers in --check output are correct' '
echo "" > x &&
Expand Down

0 comments on commit b27eb49

Please sign in to comment.