Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2] t4018: introduce test cases for the internal hunk header patterns

From: Thomas Rast <hidden>
Date: 2016-06-15 22:52:40

Brandon Casey [off-list ref] 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!
+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 <redacted>

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help