]>
Commit | Line | Data |
---|---|---|
23707811 JH |
1 | #!/bin/sh |
2 | ||
3 | test_description='diff hunk header truncation' | |
4 | ||
7ff24785 | 5 | TEST_PASSES_SANITIZE_LEAK=true |
23707811 JH |
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 | ( | |
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 | ||
28 | test_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 | ||
39 | test_done |