Re: [PATCH v4 12/39] t7201: abstract away SHA-1-specific constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 26, 2020 at 3:55 PM brian m. carlson
<sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> Adjust the test so that it computes variables for object IDs instead of
> using hard-coded hashes.
>
> Signed-off-by: brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx>
> ---
> diff --git a/t/t7201-co.sh b/t/t7201-co.sh
> @@ -230,9 +230,10 @@ test_expect_success 'switch to another branch while carrying a deletion' '
>  test_expect_success 'checkout to detach HEAD (with advice declined)' '
>         git config advice.detachedHead false &&
> +       rev=$(git rev-parse --short renamer^) &&
>         git checkout -f renamer && git clean -f &&
>         git checkout renamer^ 2>messages &&
> -       test_i18ngrep "HEAD is now at 7329388" messages &&
> +       test_i18ngrep "HEAD is now at $rev" messages &&

This test computes (and uses) the value 'rev'...

> @@ -250,7 +251,7 @@ test_expect_success 'checkout to detach HEAD' '
>         GIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages &&
> -       grep "HEAD is now at 7329388" messages &&
> +       grep "HEAD is now at $rev" messages &&

... and then this separate test re-uses that value, which
unnecessarily couples these tests tightly. How about instead just
re-computing the value of 'rev' in the second test, which will make it
easier to run individual tests while skipping others.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux