Re: [RFC PATCH v4] revision: new rev^-n shorthand for rev^n..rev
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 26, 2016, 22:11 UTC
- Message-ID
- <xmqqbmzapaza.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160926204959.26007-1-vegard.nossum@oracle.com>
Vegard Nossum <vegard.nossum@oracle.com> writes:
Show 23 quoted lines
> +test_expect_success 'rev-parse merge^-0' ' > + test_must_fail git rev-parse merge^-0 > +' > + > +test_expect_success 'rev-parse merge^-3' ' > + test_must_fail git rev-parse merge^-3 > +' > + > +test_expect_success 'rev-parse merge^-^' ' > + test_must_fail git rev-parse merge^-^ > +' > + > +test_expect_success 'rev-list merge^-0' ' > + test_must_fail git rev-list merge^-0 > +' > + > +test_expect_success 'rev-list merge^-3' ' > + test_must_fail git rev-list merge^-3 > +' > + > +test_expect_success 'rev-list merge^-^' ' > + test_must_fail git rev-list merge^-^ > +'
This seems to be testing failure cases fairly thoroughly, which is a good sign. One thing not tested is "merge^-1x" to ensure that no change mistakenly will break the strtoul() check you have to parse the parent number in the future, but other than that (and possibly reusing the set-up of an already existing test), I am fairly happy with the tests in this patch.
Thanks.