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

Re: [PATCH 1/4] t9903: add tests for git-prompt pcmode

From
Eduardo D'Avila <erdavila@gmail.com>
Date
Jun 22, 2013, 16:32 UTC
Message-ID
<CAOz-D1L3mrqTKwpnRVEEfZayFNX+eKVNC1-Ewy45tmf9MPQhtQ@mail.gmail.com>
In-Reply-To
<20130622130604.GK20052@goldbirke>
2013/6/22 SZEDER Gábor <szeder@ira.uka.de>:
Show 18 quoted lines
> On Thu, Jun 20, 2013 at 11:25:26PM -0300, Eduardo R. D'Avila wrote:
>> git-prompt.sh lacks tests for PROMPT_COMMAND mode.
>>
>> Add tests for:
>> * pcmode prompt without colors
>> * pcmode prompt with colors for bash
>> * pcmode prompt with colors for zsh
>>
>> Having these tests enables an upcoming refactor in
>> a safe way.
>>
>> Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
>
> I doubt the value of separate tests for zsh.  They might make sense as
> long as there are different code paths for doing coloring for the two
> shells, but after your refactorization in 2/4 there is only one common
> block of if statements, which is already thoroughly excercised by your
> tests for bash, making the separate tests for zsh redundant.

These tests where important to make sure that I wouldn't break anything during the refactorization. Having them pass before *and* after refactorization guarantees that nothing was broken (except for some subtle case that might have not be included in the tests).

However, I agree that they became redundant.

Would it make sense to include a patch that only removes the zsh tests, after the refactorization? I'm considering that *1* simple zsh test must be kept during this removal, to make sure the code path for zsh is run.

Eduardo
Previous: SZEDER GáborNext: Junio C Hamano
Message 4 of 15 in “git-prompt: cleaning and improvement”
  1. 0/4 git-prompt: cleaning and improvementEduardo R. D'Avila, Jun 21, 2013
  2. 1/4 t9903: add tests for git-prompt pcmodeEduardo R. D'Avila, Jun 21, 2013
  3. SZEDER GáborJun 22, 2013
  4. Eduardo D'AvilaJun 22, 2013
  5. Junio C HamanoJun 23, 2013
  6. SZEDER GáborJun 24, 2013
  7. 2/4 git-prompt.sh: refactor colored prompt codeEduardo R. D'Avila, Jun 21, 2013
  8. Øystein WalleJun 22, 2013
  9. Eduardo D'AvilaJun 22, 2013
  10. SZEDER GáborJun 23, 2013
  11. Eduardo R. D'AvilaJun 25, 2013
  12. 3/4 git-prompt.sh: do not print duplicate clean color codeEduardo R. D'Avila, Jun 21, 2013
  13. SZEDER GáborJun 22, 2013
  14. 4/4 git-prompt.sh: add missing information in commentsEduardo R. D'Avila, Jun 21, 2013
  15. SZEDER GáborJun 22, 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.