Re: [Outreachy][PATCH] Port helper/test-advise.c to unit-tests/t-advise.c
- From
Rubén Justo <rjusto@gmail.com>
- Date
- Jan 16, 2024, 11:30 UTC
- Message-ID
- <8774e3a1-3362-4ba4-9eb9-012bd9665d83@gmail.com>
- In-Reply-To
- <6b6b455e-26b8-442e-828e-506f9a152407@gmail.com>
On 15-ene-2024 20:24:47, Rubén Justo wrote:
Show 14 quoted lines
> - check_str(actual.buf, expect); > + check_str_len(actual.buf, expect, strlen(expect)); > + if (!conf_val && skip_prefix(actual.buf, expect, &hint)) > + check_str_len(hint, expect_hint_msg, strlen(expect_hint_msg)); > strbuf_release(&actual); > > if (!check(remove(out_file) == 0)) > > This implies a new check_str_len() helper, which I'm not including here > but it's a trivial copy of check_str() but using strncmp(). > > Maybe we can turn the screw a little more. > > I'm still not sure of the value in the changes in this series, though.
I hope, no one has wasted time with the code above. It is not testing correctly the conditions being probed in t-advice.c.
Take it as a way to see if this is how we want to avoid multiple instances of similar literals that might be tempting to refactor.