Re: [PATCH v4 18/39] t8002: make hash size independent
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 26, 2020, 22:49 UTC
- Message-ID
- <CAPig+cT27QQgQcq87DErR07h-p_w2q-EqDPNhGJC54=hutMPhg@mail.gmail.com>
- In-Reply-To
- <20200726195424.626969-19-sandals@crustytoothpaste.net>
On Sun, Jul 26, 2020 at 3:55 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:
> Compute the length of an object ID instead of of hard-coding 40-based
s/of of /of/
Show 20 quoted lines
> values. > > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> > --- > diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh > @@ -6,6 +6,10 @@ test_description='git blame' > +test_expect_success 'setup' ' > + test_oid_init > +' > + > @@ -105,17 +109,18 @@ test_expect_success 'blame --abbrev=<n> works' ' > test_expect_success 'blame -l aligns regular and boundary commits' ' > + hexsz=$(test_oid hexsz) && > + check_abbrev $hexsz -l HEAD && > + check_abbrev $((hexsz - 1)) -l ^HEAD > ' > +test_expect_success 'blame --abbrev with full length behaves like -l' ' > + check_abbrev $hexsz --abbrev=$hexsz HEAD && > + check_abbrev $((hexsz - 1)) --abbrev=$hexsz ^HEAD > '
Rather than assigning 'hexsz' in the first test which needs the value and then re-using the value in subsequent tests, how about assigning 'hexsz' in the new "setup" test? This will make it easier to run individual tests while skipping others.