Re: [PATCH 03/20] t5505-remote.sh: check the behavior without a subcommand
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 25, 2022, 14:37 UTC
- Message-ID
- <220725.86ilnlp89v.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <20220725123857.2773963-4-szeder.dev@gmail.com>
On Mon, Jul 25 2022, SZEDER Gábor wrote:
Show 40 quoted lines
> t/t5505-remote.sh | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh > index 6c7370f87f..f075dd4afa 100755 > --- a/t/t5505-remote.sh > +++ b/t/t5505-remote.sh > @@ -241,6 +241,35 @@ test_expect_success 'add invalid foreign_vcs remote' ' > test_cmp expect actual > ' > > +test_expect_success 'without subcommand' ' > + ( > + cd test && > + git remote >actual && > + echo origin >expect && > + test_cmp expect actual > + ) > +' > + > +test_expect_success 'without subcommand accepts -v' ' > + cat >test/expect <<-EOF && > + origin $(pwd)/one (fetch) > + origin $(pwd)/one (push) > + EOF > + ( > + cd test && > + git remote -v >actual && > + test_cmp expect actual > + ) > +' > + > +test_expect_success 'without subcommand does not take arguments' ' > + ( > + cd test && > + test_expect_code 129 git remote origin 2>err && > + grep "^error: Unknown subcommand:" err > + ) > +' > +
This can be shortened quite a bit by getting rid of the sub-shells: https://github.com/avar/git/commit/e8eebd4eef6
But that version came from an earlier version of yours without those -v tests...