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>
Eric Sunshine committed
Aug 6, 2013 at 09:59 UTC
9527604f7d6490fd4ce0809fe8fc8a600e03710d
1 file changed
+12
t/annotate-tests.sh
+12
@@ -185,6 +185,18 @@ test_expect_success 'blame -L Y,X (undocumented)' '
185
check_count -L6,3 B 1 B1 1 B2 1 D 1
186
'
187
188
+test_expect_failure 'blame -L -X' '
189
+ test_must_fail $PROG -L-1 file
190
+'
191
+
192
+test_expect_failure 'blame -L 0' '
193
+ test_must_fail $PROG -L0 file
194
+'
195
+
196
+test_expect_failure 'blame -L ,0' '
197
+ test_must_fail $PROG -L,0 file
198
+'
199
+
200
test_expect_success 'blame -L ,+0' '
201
test_must_fail $PROG -L,+0 file
202
'