From: Eric Sunshine Date: Tue, 06 Aug 2013 13:59:48 GMT Subject: [PATCH v2 15/16] t8001/t8002: blame: add tests of -L line numbers less than 1 Message-ID: <1375797589-65308-16-git-send-email-sunshine@sunshineco.com> In-Reply-To: <1375797589-65308-1-git-send-email-sunshine@sunshineco.com> 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 --- t/annotate-tests.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh index dabe89d..376b042 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 ' -- 1.8.4.rc1.409.gbd48715