]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4025-hunk-header.sh
Start the 2.46 cycle
[thirdparty/git.git] / t / t4025-hunk-header.sh
CommitLineData
23707811
JH
1#!/bin/sh
2
3test_description='diff hunk header truncation'
4
7ff24785 5TEST_PASSES_SANITIZE_LEAK=true
23707811
JH
6. ./test-lib.sh
7
8N='日本語'
9N1='日'
10N2='日本'
11NS="$N$N$N$N$N$N$N$N$N$N$N$N$N"
12
13test_expect_success setup '
14
15 (
f957f03b 16 echo "A $NS" &&
efe26b9e 17 printf " %s\n" B C D E F G H I J K &&
f957f03b 18 echo "L $NS" &&
efe26b9e 19 printf " %s\n" M N O P Q R S T U V
23707811
JH
20 ) >file &&
21 git add file &&
22
23 sed -e "/^ [EP]/s/$/ modified/" <file >file+ &&
24 mv file+ file
25
26'
27
28test_expect_success 'hunk header truncation with an overly long line' '
29
30 git diff | sed -n -e "s/^.*@@//p" >actual &&
31 (
f957f03b 32 echo " A $N$N$N$N$N$N$N$N$N2" &&
23707811
JH
33 echo " L $N$N$N$N$N$N$N$N$N1"
34 ) >expected &&
dcbaa0b3 35 test_cmp expected actual
23707811
JH
36
37'
38
39test_done