Re: [PATCH] test-lib-functions: fix test_subcommand_inexact
- From
Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
- Date
- Mar 24, 2022, 18:10 UTC
- Message-ID
- <20220324181056.53824-1-chakrabortyabhradeep79@gmail.com>
- In-Reply-To
- <xmqqmthgu3e6.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> The result of doing #1 is still "inexact" but at that point it is > unclear if we are being way too inexact to be useful. If the > looseness bothers us too much, we may decide that #1 is not worth > doing. But obviously the looseness did not bother us that much > until last week, so probably an obvious #3, do nothing, letting the > sleeping dog lie, might be what we want to do?
Personally, I would prefer #3 i.e. do nothing (even in the future; unless it is removed all together). I also think that the current behaviour is not "too inexact". Rather it would be too strict for `test_subcommand_inexact` if we remove the ".*" thing here.
Inexact means that the line needs not to be exactly same - there may be some words in between the desired words (in this case, any flags that come between the desired sub-commands). The current behaviour (i.e. `local expr=$(printf '"%s".*' "$@")`) is justifying the name of the function. Replacing ".*" with "," will therefore not work as the name of the function suggests - it will rather work as `test_subcommand_starts_with`.
Only the `expr=${expr%,}.*" line needs to be changed, I think.Thanks :)