From: Wincent Colaiuta <win@wincent.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Wincent Colaiuta <win@wincent.com>
Subject: [PATCH 4/4] Add tests for "git diff --check" with core.whitespace options
Date: Wed, 12 Dec 2007 17:23:02 +0100 [thread overview]
Message-ID: <1197476582-18956-5-git-send-email-win@wincent.com> (raw)
In-Reply-To: <1197476582-18956-4-git-send-email-win@wincent.com>
Make sure that "git diff --check" does the right thing when the
core.whitespace options are set.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
---
t/t4015-diff-whitespace.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index ff77a16..8d980af 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -256,4 +256,52 @@ test_expect_failure 'check mixed spaces and tabs in indent' '
'
+test_expect_success 'check trailing whitespace (trailing-space: off)' '
+
+ git config core.whitespace "-trailing-space" &&
+ echo "foo (); " > x &&
+ git diff --check
+
+'
+
+test_expect_failure 'check trailing whitespace (trailing-space: on)' '
+
+ git config core.whitespace "trailing-space" &&
+ echo "foo (); " > x &&
+ git diff --check
+
+'
+
+test_expect_success 'check space before tab in indent (space-before-tab: off)' '
+
+ git config core.whitespace "-space-before-tab" &&
+ echo " foo ();" > x &&
+ git diff --check
+
+'
+
+test_expect_failure 'check space before tab in indent (space-before-tab: on)' '
+
+ git config core.whitespace "space-before-tab" &&
+ echo " foo (); " > x &&
+ git diff --check
+
+'
+
+test_expect_success 'check spaces as indentation (indent-with-non-tab: off)' '
+
+ git config core.whitespace "-indent-with-non-tab"
+ echo " foo ();" > x &&
+ git diff --check
+
+'
+
+test_expect_failure 'check spaces as indentation (indent-with-non-tab: on)' '
+
+ git config core.whitespace "indent-with-non-tab" &&
+ echo " foo ();" > x &&
+ git diff --check
+
+'
+
test_done
--
1.5.3.7.1159.g2f071-dirty
next prev parent reply other threads:[~2007-12-12 16:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 16:22 [PATCH 0/4] Refactoring for apply and diff Wincent Colaiuta
2007-12-12 16:22 ` [PATCH 1/4] Fix "diff --check" whitespace detection Wincent Colaiuta
2007-12-12 16:23 ` [PATCH 2/4] Extract and improve whitespace check from "git apply" Wincent Colaiuta
2007-12-12 16:23 ` [PATCH 3/3] Make "diff --check" use shared whitespace functions Wincent Colaiuta
2007-12-12 16:23 ` Wincent Colaiuta [this message]
2007-12-12 19:39 ` [PATCH 2/4] Extract and improve whitespace check from "git apply" Junio C Hamano
2007-12-12 22:50 ` Wincent Colaiuta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1197476582-18956-5-git-send-email-win@wincent.com \
--to=win@wincent.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.