Re: [PATCH v2] t4018: introduce test cases for the internal hunk header patterns
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Dec 20, 2011, 09:13 UTC
- Message-ID
- <87ty4vli5s.fsf@thomas.inf.ethz.ch>
- In-Reply-To
- <1324348939-27115-1-git-send-email-drafnel@gmail.com>
Brandon Casey <drafnel@gmail.com> writes:
> Let's introduce some infrastructure to make it easy to create test cases > for the hunk header patterns and provide a few cases for the cpp pattern.
[...]
> int WRONG_function_hunk_header (void)
[...]
> int RIGHT_function_hunk_header (void)
> {
> const char *msg = "ChangeMe";Excellent idea!
Show 6 quoted lines
> +template <class T> int RIGHT_function_hunk_header (T unused)
> +{
> + const char *msg = "ChangeMe";
> + printf("Hello, world, %s\n", msg);
> + return 0;
> +}I'd still like to have an extremely contrived overuse of templated classes, like so:
---- 8< ----
int WRONG_function_hunk_header_preceding_the_right_one (void)
{
return 0;
}foo::RIGHT<int*&,1>::operator<<(int bar)
{
const char *msg = "ChangeMe";
printf("Hello, world, %s\n", msg);
return 0;
}int WRONG_function_hunk_header_following_the_right_one (void)
{
return 0;
}
---- >8 ----That will guard us against updating the C++ pattern to something better but still slightly too simple.
Other than that and Jakub's comments,
Acked-by: Thomas Rast <trast@student.ethz.ch>
--
Thomas Rast
trast@{inf,student}.ethz.ch