mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
whitespace: tests for git-diff --check with tab-in-indent error class
[jc: with test fixes from J6t] Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3e3ec2abe0
commit
b27eb49948
|
@ -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 &&
|
||||
|
|
Loading…
Reference in a new issue