git-commit-vandalism/t/t4018
Alban Gruin 1dbf0c0ad6 userdiff: add built-in pattern for golang
This adds xfuncname and word_regex patterns for golang, a quite
popular programming language. It also includes test cases for the
xfuncname regex (t4018) and updated documentation.

The xfuncname regex finds functions, structs and interfaces.  Although
the Go language prohibits the opening brace from being on its own
line, the regex does not makes it mandatory, to be able to match
`func` statements like this:

    func foo(bar int,
    	baz int) {
    }

This is covered by the test case t4018/golang-long-func.

The word_regex pattern finds identifiers, integers, floats, complex
numbers and operators, according to the go specification.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-03-01 13:36:49 -08:00
..
cpp-c++-function
cpp-class-constructor userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-class-constructor-mem-init
cpp-class-definition t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
cpp-class-definition-derived t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
cpp-class-destructor userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-function-returning-global-type
cpp-function-returning-nested userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-function-returning-pointer
cpp-function-returning-reference userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-gnu-style-function
cpp-namespace-definition userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-operator-definition
cpp-skip-access-specifiers t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
cpp-skip-comment-block t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
cpp-skip-labels t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
cpp-struct-definition t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
cpp-struct-single-line userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-template-function-definition
cpp-union-definition userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
cpp-void-c-function
css-brace-in-col-1
css-colon-eol
css-colon-selector
css-common userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-long-selector-list
css-prop-sans-indent userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-short-selector-list
css-trailing-space userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
custom1-pattern
custom2-match-to-end-of-line
custom3-alternation-in-pattern t4018: convert custom pattern test to the new infrastructure 2014-03-21 15:02:57 -07:00
fountain-scene
golang-complex-function
golang-func userdiff: add built-in pattern for golang 2018-03-01 13:36:49 -08:00
golang-interface userdiff: add built-in pattern for golang 2018-03-01 13:36:49 -08:00
golang-long-func
golang-struct
java-class-member-function t4018: convert java pattern test to the new infrastructure 2014-03-21 15:02:36 -07:00
perl-skip-end-of-heredoc t4018: convert perl pattern tests to the new infrastructure 2014-03-21 15:02:19 -07:00
perl-skip-forward-decl
perl-skip-sub-in-pod t4018: convert perl pattern tests to the new infrastructure 2014-03-21 15:02:19 -07:00
perl-sub-definition
perl-sub-definition-kr-brace t4018: convert perl pattern tests to the new infrastructure 2014-03-21 15:02:19 -07:00
README t4018: an infrastructure to test hunk headers 2014-03-21 15:00:51 -07:00

How to write RIGHT test cases
=============================

Insert the word "ChangeMe" (exactly this form) at a distance of
at least two lines from the line that must appear in the hunk header.

The text that must appear in the hunk header must contain the word
"right", but in all upper-case, like in the title above.

To mark a test case that highlights a malfunction, insert the word
BROKEN in all lower-case somewhere in the file.

This text is a bit twisted and out of order, but it is itself a
test case for the default hunk header pattern. Know what you are doing
if you change it.

BTW, this tests that the head line goes to the hunk header, not the line
of equal signs.