interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t4025-hunk-header.sh

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