git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git Test Coverage Report (Thursday, June 6 2019)

From
Philip Oakley <philipoakley@iee.org>
Date
Jun 8, 2019, 22:15 UTC
Message-ID
<f28dd5b1-fda8-cf51-5582-067a7d2c2472@iee.org>
In-Reply-To
<396091fc-5572-19a5-4f18-61c258590dd5@gmail.com>
Hi Stollee
On 07/06/2019 02:19, Derrick Stolee wrote:
Show 35 quoted lines
> Here is today's test coverage report.
>
> Thanks,
> -Stolee
>
> [1] https://derrickstolee.github.io/git-test-coverage/reports/2019-06-06.htm
> [2] https://derrickstolee.github.io/git-test-coverage/reports/2019-06-06.txt
>
> ---
>
> pu	4f91bbec8a3cc2fff435fb3dbb0dfa5f9d223141
> jch	e1895a3c3b1fef6d1bc80251d09598e219d3908d
> next	ee3066bb6536c68f973b3c0ffaaa13f4bfda5ea3
> master	74583d89127e21255c12dd3c8a3bf60b497d7d03
> master@{1}	aa25c82427ae70aebf3b8f970f2afd54e9a2a8c6
>
>
> Uncovered code in 'pu' not in 'jch'
> --------------------------------------------------------
>
> [snip]
>
>
> Uncovered code in 'jch' not in 'next'
> --------------------------------------------------------
>
> builtin/branch.c
> 1fde99cf 841) die(_("The -a, and -r, options to 'git branch' do not take a branch name.\n"
>
> [nip]
>
> Commits introducting uncovered code:
> ...
> Philip Oakley	1fde99cf doc branch: provide examples for listing remote tracking branches
> [snip rest]

The change was just a change to the die() message, but was not tested previously.

I've guessed that t3203 would be the right place for an extra test which I've hacked (but not yet tested) as

---
phili@Philip-Win10 MINGW64 /usr/src/git (branch-patterns-v2)
$ git show -1
commit d5a799d8833b0ae195915eefd5365f3fc4c7c0a4 (HEAD -> 
branch-patterns-v2, my/branch-patterns-v2)
Author: Philip Oakley <philipoakley@iee.org>
Date:   Sat Jun 8 22:50:06 2019 +0100
     t3203-branch-output: test -a & -r pattern options
     Users may wrongly use the -r and -a options with a branch pattern when
     looking for a remote tracking branch. Test that we fail for that 
misuse.
     Signed-off-by: Philip Oakley <philipoakley@iee.org>
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index ee6787614c..e78bd1c56d 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -264,4 +264,9 @@ test_expect_success '--color overrides auto-color' '
         test_cmp expect.color actual
  '

+test_expect_success '-a & -r options do not take a branch name, without 
--list' '
+       test_must_fail git branch -a HEAD
+       test_must_fail git branch -r HEAD
+'
+
  test_done
---
https://github.com/PhilipOakley/git/commit/d5a799d8833b0ae195915eefd5365f3fc4c7c0a4

Not sure if that's the right way to do it (Its my first proper try at 
tests themselves..)

I'm going to be away for about a week with only intermittent internet 
hence the unfinished reply.
--
Philip
Previous: Derrick Stolee
Message 3 of 3 in “Git Test Coverage Report (Thursday, June 6 2019)”
  1. Derrick StoleeJun 7, 2019
  2. Derrick StoleeJun 7, 2019
  3. Philip OakleyJun 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.