summaryrefslogtreecommitdiffstats
path: root/t/annotate-tests.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2013-08-06 15:59:48 +0200
committerJunio C Hamano <gitster@pobox.com>2013-08-06 23:48:29 +0200
commit9527604f7d6490fd4ce0809fe8fc8a600e03710d (patch)
tree30211b228f0d1552084c523eed14273a919ad493 /t/annotate-tests.sh
parentline-range: teach -L^:RE to search from start of file (diff)
downloadgit-9527604f7d6490fd4ce0809fe8fc8a600e03710d.tar.xz
git-9527604f7d6490fd4ce0809fe8fc8a600e03710d.zip
t8001/t8002: blame: add tests of -L line numbers less than 1
git-blame -L is documented as accepting 1-based line numbers. When handed a line number less than 1, -L's behavior is undocumented and undefined; it's also nonsensical and should be rejected but is nevertheless accepted. Demonstrate this shortcoming. 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.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index dabe89d91a..376b042f2f 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -185,6 +185,18 @@ test_expect_success 'blame -L Y,X (undocumented)' '
check_count -L6,3 B 1 B1 1 B2 1 D 1
'
+test_expect_failure 'blame -L -X' '
+ test_must_fail $PROG -L-1 file
+'
+
+test_expect_failure 'blame -L 0' '
+ test_must_fail $PROG -L0 file
+'
+
+test_expect_failure 'blame -L ,0' '
+ test_must_fail $PROG -L,0 file
+'
+
test_expect_success 'blame -L ,+0' '
test_must_fail $PROG -L,+0 file
'