@ -56,6 +56,10 @@ check_count () {
@@ -56,6 +56,10 @@ check_count () {
' "$@" <actual
}
get_progress_result () {
tr '\015' '\012' | tail -n 1
}
test_expect_success 'setup A lines' '
echo "1A quick brown fox jumps over the" >file &&
echo "lazy dog" >>file &&
@ -604,3 +608,39 @@ test_expect_success 'blame -L X,-N (non-numeric N)' '
@@ -604,3 +608,39 @@ test_expect_success 'blame -L X,-N (non-numeric N)' '
test_expect_success 'blame -L ,^/RE/' '
test_must_fail $PROG -L1,^/99/ file
'
test_expect_success 'blame progress on a full file' '
cat >expect <<-\EOF &&
Blaming lines: 100% (10/10), done.
EOF
GIT_PROGRESS_DELAY=0 \
git blame --progress hello.c 2>stderr &&
get_progress_result <stderr >actual &&
test_cmp expect actual
'
test_expect_success 'blame progress on a single range' '
cat >expect <<-\EOF &&
Blaming lines: 100% (4/4), done.
EOF
GIT_PROGRESS_DELAY=0 \
git blame --progress -L 3,6 hello.c 2>stderr &&
get_progress_result <stderr >actual &&
test_cmp expect actual
'
test_expect_success 'blame progress on multiple ranges' '
cat >expect <<-\EOF &&
Blaming lines: 100% (7/7), done.
EOF
GIT_PROGRESS_DELAY=0 \
git blame --progress -L 3,6 -L 8,10 hello.c 2>stderr &&
get_progress_result <stderr >actual &&
test_cmp expect actual
'