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

Re: [PATCH v14 3/6] t0040-parse-options: improve test coverage

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 13, 2016, 17:27 UTC
Message-ID
<CAPig+cSvvAJT6yb2h6B1S5LDr8H03t-b66rmbKWpo88Fw-ehmg@mail.gmail.com>
In-Reply-To
<CAFZEwPMU5KSoBJ0kHGnnPCq0zsoj8ROAXhJ9HFn66fqDehvWGw@mail.gmail.com>
On Wed, Apr 13, 2016 at 4:59 AM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
Show 24 quoted lines
> On Wed, Apr 13, 2016 at 10:56 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> On Tue, Apr 12, 2016 at 7:02 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
>>> +test_expect_success '--no-quiet sets quiet to 0' '
>>> +       test-parse-options --no-quiet >output 2>output.err &&
>>
>> Meh, as implemented, this isn't a very interesting test, is it?
>> 'quiet' started at 0, so all this shows is that --no-quiet didn't
>> disturb the 0. To really test that it resets it to 0, you'd want:
>>
>>     test-parse-options --quiet --no-quiet >... 2>... &&
>>
>>> +       test_must_be_empty output.err &&
>>> +       test_cmp expect output
>>> +'
>>>  test_done
>
> This is to test whether the 0 of quiet remains 0 if --no-quiet is
> included. This test "defines" the current behavior. Then when I change
> OPT_COUNTUP(), this test will ensure that this behavior is not
> interrupted as promised by the commit message of that patch[1]. I
> guess this also describe why I choose to include these tests between
> 2/5 and 3/5 rather than 3/5 and 4/5. And also see the extended
> discussion[2] for this. If I do a re-roll then I include `--quiet`
> before `--no-quiet`

Each of these patches should have a single conceptual purpose. It seems, from the above explanation, that you're mixing and mismatching bits of such changes between patches.

* The two new tests for --no-verbose and --no-quiet should be together
and check that they correctly reverse --verbose and --quiet,
respectively.
* The test you describe above which ensures that --no-quiet leaves
'quiet' at 0 should be bundled with the change that might break that
behavior, namely, the OPT__COUNTUP() change.
Previous: Pranit BauvaNext: Pranit Bauva
Message 6 of 22 in “t0040-test-parse-options.sh: fix style issues”
  1. 1/6 t0040-test-parse-options.sh: fix style issuesPranit Bauva, Apr 12, 2016
  2. 2/6 test-parse-options: print quiet as integerPranit Bauva, Apr 12, 2016
  3. 3/6 t0040-parse-options: improve test coveragePranit Bauva, Apr 12, 2016
  4. Eric SunshineApr 13, 2016
  5. Pranit BauvaApr 13, 2016
  6. Eric SunshineApr 13, 2016
  7. Pranit BauvaApr 25, 2016
  8. Eric SunshineApr 27, 2016
  9. Pranit BauvaApr 27, 2016
  10. 6/6 commit: add a commit.verbose config variablePranit Bauva, Apr 12, 2016
  11. Eric SunshineApr 13, 2016
  12. Pranit BauvaApr 13, 2016
  13. Eric SunshineApr 13, 2016
  14. 4/6 parse-options.c: make OPTION_COUNTUP respect "unspecified" valuesPranit Bauva, Apr 12, 2016
  15. Eric SunshineApr 13, 2016
  16. Pranit BauvaApr 13, 2016
  17. Eric SunshineApr 13, 2016
  18. Pranit BauvaApr 13, 2016
  19. Eric SunshineApr 13, 2016
  20. 5/6 t7507-commit-verbose: improve test coverage by testing number of diffsPranit Bauva, Apr 12, 2016
  21. Eric SunshineApr 13, 2016
  22. Pranit BauvaApr 13, 2016

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.