aboutsummaryrefslogtreecommitdiff
path: root/t/annotate-tests.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2013-08-06 09:59:46 -0400
committerJunio C Hamano <gitster@pobox.com>2013-08-06 14:47:34 -0700
commit1ce761a524e34f2d629759cb57c67d13acbe4a7a (patch)
tree6743d31c57b24481ff251a26ba56ec6eda935d60 /t/annotate-tests.sh
parenta6ac5f9864958f65269d8d58a049324403b039fd (diff)
downloadgit-1ce761a524e34f2d629759cb57c67d13acbe4a7a.tar.gz
git-1ce761a524e34f2d629759cb57c67d13acbe4a7a.tar.xz
line-range: teach -L:RE to search from end of previous -L range
For consistency with -L/RE/, teach -L:RE to search relative to the end of the previous -L range, if any. The new behavior invalidates one test in t4211 which assumes that -L:RE begins searching at start of file. This test will be resurrected in a follow-up patch which teaches -L:RE how to override the default relative search behavior. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/annotate-tests.sh')
-rw-r--r--t/annotate-tests.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 5a7d7c72d..4f7d6baef 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -382,6 +382,22 @@ test_expect_success 'blame -L :nomatch' '
test_must_fail $PROG -L:nomatch hello.c
'
+test_expect_success 'blame -L :RE (relative)' '
+ check_count -f hello.c -L3,3 -L:ma.. F 1 H 4
+'
+
+test_expect_success 'blame -L :RE (relative: no preceding range)' '
+ check_count -f hello.c -L:ma.. F 4 G 1
+'
+
+test_expect_success 'blame -L :RE (relative: not found)' '
+ test_must_fail $PROG -L3,3 -L:tambourine hello.c
+'
+
+test_expect_success 'blame -L :RE (relative: end-of-file)' '
+ test_must_fail $PROG -L, -L:main hello.c
+'
+
test_expect_success 'setup incremental' '
(
GIT_AUTHOR_NAME=I &&