Re: [PATCH v2] t4018: introduce test cases for the internal hunk header patterns
Brandon Casey <drafnel@gmail.com> writes:
Show 25 quoted lines
> diff --git a/t/t4018/ignore_global.cpp b/t/t4018/ignore_global.cpp
> new file mode 100644
> index 0000000..95e23bc
> --- /dev/null
> +++ b/t/t4018/ignore_global.cpp
> @@ -0,0 +1,19 @@
> +int WRONG_function_hunk_header_preceding_the_right_one (void)
> +{
> + return 0;
> +}
> +
> +int RIGHT_function_hunk_header (void)
> +{
> + printf("Hello, world\n");
> + return 0;
> +}
> +
> +int WRONG_global_variable;
> +
> +int ChangeMe;
> +
> +int WRONG_function_hunk_header_following_the_right_one (void)
> +{
> + return 0;
> +}Shouldn't ChangeMe be inside function?
Show 14 quoted lines
> diff --git a/t/t4018/simple.cpp b/t/t4018/simple.cpp
> new file mode 100644
> index 0000000..c96ad87
> --- /dev/null
> +++ b/t/t4018/simple.cpp
> @@ -0,0 +1,32 @@
> +/*
> + * Test file for testing the internal hunk header patterns
> + *
> + * The "RIGHT" hunk header function, the one that should appear on the
> + * hunk header line, should be named "RIGHT_function_hunk_header" and
> + * the body of this function should have an assignment that looks like
> + *
> + * answer = 0
Shouldn't it be ChangeMe?
Show 7 quoted lines
> + *
> + * within it, deep enough so the lines of context do not include the
> + * function name.
> + *
> + * If the name of this file begins with "broken_", then it will be
> + * interpreted as a pattern which does not work, but which should.
> + */
--
Jakub Narêbski