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

Re: [PATCH 0/5] range-set and line-log bug fixes

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jul 25, 2013, 09:12 UTC
Message-ID
<51F0EBF5.80105@viscovery.net>
In-Reply-To
<CAPig+cRWaKv6UN5pZLwonXBpHnFE7+4ELXTnE+2nLr8h83bX6Q@mail.gmail.com>
Am 7/25/2013 10:03, schrieb Eric Sunshine:
Show 5 quoted lines
> The tests in this series identify real bugs in dealing with empty
> ranges, which the subsequent patches fix. The test are possible
> because one can specify an empty range via blame/log -L, however, I
> now realize that the ability for -L to create empty ranges was never
> intended or part of the design, but is in fact itself a bug.
...
Show 7 quoted lines
> * Should we drop these new t4211 tests which guard against real potential bugs?
> 
> * Should we add custom C code to the test suite to make the
> empty-range testing possible?
> 
> * Should we introduce another (undocumented) loophole just for the
> sake of the tests?

IIUC, the tests you added are protecting the *implementation* of range-set functions. For tests of the implementation, we usually write test-foo programs that call the functions directly.

Tests invoking git should test the observable behavior. Therefore, if calling a git utility with "-Lfoo,+0" should be an error, then the test suite should mark such a call with test_must_fail. I guess this rules out the loophole approach.

-- Hannes
Previous: Eric SunshineNext: Eric Sunshine
Message 16 of 17 in “range-set and line-log bug fixes”
  1. 0/5 range-set and line-log bug fixesEric Sunshine, Jul 23, 2013
  2. 1/5 range-set: fix sort_and_merge_range_set() corner case bugEric Sunshine, Jul 23, 2013
  3. 2/5 t4211: demonstrate empty -L range crashEric Sunshine, Jul 23, 2013
  4. SZEDER GáborJul 23, 2013
  5. Junio C HamanoJul 23, 2013
  6. SZEDER GáborJul 23, 2013
  7. Eric SunshineJul 23, 2013
  8. Junio C HamanoJul 24, 2013
  9. Eric SunshineJul 24, 2013
  10. 3/5 range-set: satisfy non-empty ranges invariantEric Sunshine, Jul 23, 2013
  11. 4/5 t4211: demonstrate crash when first -L encountered is empty rangeEric Sunshine, Jul 23, 2013
  12. 5/5 line-log: fix "log -LN" crash when N is last line of fileEric Sunshine, Jul 23, 2013
  13. Thomas RastJul 23, 2013
  14. Eric SunshineJul 25, 2013
  15. Eric SunshineJul 25, 2013
  16. Johannes SixtJul 25, 2013
  17. Eric SunshineJul 25, 2013

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.