git/t/t4018
William Duclot 0719f3eecd userdiff: add built-in pattern for CSS
CSS is widely used, motivating it being included as a built-in pattern.

It must be noted that the word_regex for CSS (i.e. the regex defining
what is a word in the language) does not consider '.' and '#' characters
(in CSS selectors) to be part of the word. This behavior is documented
by the test t/t4018/css-rule.
The logic behind this behavior is the following: identifiers in CSS
selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'
character are not part of the identifier, but an indicator of the nature
of the identifier in HTML/XML (class or id). Diffing ".class1" and
".class2" must show that the class name is changed, but we still are
selecting a class.

Logic behind the "pattern" regex is:
    1. reject lines ending with a colon/semicolon (properties)
    2. if a line begins with a name in column 1, pick the whole line

Credits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most
of the tests.

Signed-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-03 14:45:56 -07:00
..
cpp-c++-function t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
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 userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
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 userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
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 t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
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 userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
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 userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
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 userdiff: have 'cpp' hunk header pattern catch more C++ anchor points 2014-03-21 15:03:32 -07:00
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 t4018: test cases for the built-in cpp pattern 2014-03-21 15:03:29 -07:00
css-brace-in-col-1 userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-colon-eol userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-colon-selector userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-common userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-long-selector-list userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-prop-sans-indent userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-short-selector-list userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
css-trailing-space userdiff: add built-in pattern for CSS 2016-06-03 14:45:56 -07:00
custom1-pattern t4018: convert custom pattern test to the new infrastructure 2014-03-21 15:02:57 -07:00
custom2-match-to-end-of-line t4018: convert custom pattern test to the new infrastructure 2014-03-21 15:02:57 -07:00
custom3-alternation-in-pattern t4018: convert custom pattern test to the new infrastructure 2014-03-21 15:02:57 -07:00
fountain-scene userdiff: add support for Fountain documents 2015-07-23 14:44:51 -07:00
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
perl-skip-forward-decl
perl-skip-sub-in-pod
perl-sub-definition
perl-sub-definition-kr-brace
README

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.