]> git.ipfire.org Git - thirdparty/git.git/blob - t/t4025-hunk-header.sh
repo-settings: rename the traditional default fetch.negotiationAlgorithm
[thirdparty/git.git] / t / t4025-hunk-header.sh
1 #!/bin/sh
2
3 test_description='diff hunk header truncation'
4
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 N='日本語'
9 N1='日'
10 N2='日本'
11 NS="$N$N$N$N$N$N$N$N$N$N$N$N$N"
12
13 test_expect_success setup '
14
15 (
16 echo "A $NS" &&
17 for c in B C D E F G H I J K
18 do
19 echo " $c"
20 done &&
21 echo "L $NS" &&
22 for c in M N O P Q R S T U V
23 do
24 echo " $c"
25 done
26 ) >file &&
27 git add file &&
28
29 sed -e "/^ [EP]/s/$/ modified/" <file >file+ &&
30 mv file+ file
31
32 '
33
34 test_expect_success 'hunk header truncation with an overly long line' '
35
36 git diff | sed -n -e "s/^.*@@//p" >actual &&
37 (
38 echo " A $N$N$N$N$N$N$N$N$N2" &&
39 echo " L $N$N$N$N$N$N$N$N$N1"
40 ) >expected &&
41 test_cmp expected actual
42
43 '
44
45 test_done