Merge branch 'fixes/2.45.1/2.41' into fixes/2.45.1/2.42
[alt-git.git] / t / t4025-hunk-header.sh
blob5397cb7d42d748054eb5a244415c2f5062e3eca2
1 #!/bin/sh
3 test_description='diff hunk header truncation'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 N='日本語'
9 N1='日'
10 N2='日本'
11 NS="$N$N$N$N$N$N$N$N$N$N$N$N$N"
13 test_expect_success setup '
16 echo "A $NS" &&
17 printf " %s\n" B C D E F G H I J K &&
18 echo "L $NS" &&
19 printf " %s\n" M N O P Q R S T U V
20 ) >file &&
21 git add file &&
23 sed -e "/^ [EP]/s/$/ modified/" <file >file+ &&
24 mv file+ file
28 test_expect_success 'hunk header truncation with an overly long line' '
30 git diff | sed -n -e "s/^.*@@//p" >actual &&
32 echo " A $N$N$N$N$N$N$N$N$N2" &&
33 echo " L $N$N$N$N$N$N$N$N$N1"
34 ) >expected &&
35 test_cmp expected actual
39 test_done