summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-04-22 11:26:56 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-22 11:26:56 -0700
commit21247455f328fcf26fc4f78134bcc6f8a676fa8a (patch)
treee2ffee5d17870e5cfd69fb0e915a3568c42dfd33 /t
parentMerge branch 'ap/combine-diff-ignore-whitespace' into maint (diff)
parenttest: resurrect q_to_tab (diff)
downloadtgif-21247455f328fcf26fc4f78134bcc6f8a676fa8a.tar.xz
Merge branch 'jc/apply-ws-fix-tab-in-indent' into maint
* jc/apply-ws-fix-tab-in-indent: test: resurrect q_to_tab apply --whitespace=fix: avoid running over the postimage buffer
Diffstat (limited to 't')
-rwxr-xr-xt/t4124-apply-ws-rule.sh26
-rwxr-xr-xt/t4150-am.sh2
-rw-r--r--t/test-lib-functions.sh4
3 files changed, 31 insertions, 1 deletions
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index 581a801649..5d0c598338 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -486,4 +486,30 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '
test_cmp one expect
'
+test_expect_success 'whitespace=fix to expand' '
+ qz_to_tab_space >preimage <<-\EOF &&
+ QQa
+ QQb
+ QQc
+ ZZZZZZZZZZZZZZZZd
+ QQe
+ QQf
+ QQg
+ EOF
+ qz_to_tab_space >patch <<-\EOF &&
+ diff --git a/preimage b/preimage
+ --- a/preimage
+ +++ b/preimage
+ @@ -1,7 +1,6 @@
+ QQa
+ QQb
+ QQc
+ -QQd
+ QQe
+ QQf
+ QQg
+ EOF
+ git -c core.whitespace=tab-in-indent apply --whitespace=fix patch
+'
+
test_done
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index cdafd7e7c1..12f6b027ac 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup: messages' '
vero eos et accusam et justo duo dolores et ea rebum.
EOF
- q_to_tab <<-\EOF >>msg &&
+ qz_to_tab_space <<-\EOF >>msg &&
QDuis autem vel eum iriure dolor in hendrerit in vulputate velit
Qesse molestie consequat, vel illum dolore eu feugiat nulla facilisis
Qat vero eros et accumsan et iusto odio dignissim qui blandit
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index fa62d010f6..3fc9cc9288 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -91,6 +91,10 @@ q_to_tab () {
tr Q '\011'
}
+qz_to_tab_space () {
+ tr QZ '\011\040'
+}
+
append_cr () {
sed -e 's/$/Q/' | tr Q '\015'
}