]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/userdiff-tests'
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Apr 2021 00:23:34 +0000 (17:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Apr 2021 00:23:34 +0000 (17:23 -0700)
A bit of code clean-up and a lot of test clean-up around userdiff
area.

* ab/userdiff-tests:
  blame tests: simplify userdiff driver test
  blame tests: don't rely on t/t4018/ directory
  userdiff: remove support for "broken" tests
  userdiff tests: list builtin drivers via test-tool
  userdiff tests: explicitly test "default" pattern
  userdiff: add and use for_each_userdiff_driver()
  userdiff style: normalize pascal regex declaration
  userdiff style: declare patterns with consistent style
  userdiff style: re-order drivers in alphabetical order

1  2 
Makefile
t/helper/test-tool.c
t/helper/test-tool.h
userdiff.c

diff --cc Makefile
Simple merge
Simple merge
Simple merge
diff --cc userdiff.c
index 3897317aff892a22bd3d3cd6ba66b35203e9ef6d,a667ccaa8c518b5930b5b4a931d4ebca79300af6..3c3bbe38b048dbbcf968699bb65a83fb2646032e
@@@ -191,55 -238,8 +238,17 @@@ PATTERNS("rust"
         "[a-zA-Z_][a-zA-Z0-9_]*"
         "|[0-9][0-9_a-fA-Fiosuxz]*(\\.([0-9]*[eE][+-]?)?[0-9_fF]*)?"
         "|[-+*\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\|\\||->|=>|\\.{2}=|\\.{3}|::"),
- PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
-        "[={}\"]|[^={}\" \t]+"),
 +PATTERNS("scheme",
 +       "^[\t ]*(\\(((define|def(struct|syntax|class|method|rules|record|proto|alias)?)[-*/ \t]|(library|module|struct|class)[*+ \t]).*)$",
 +       /*
 +        * R7RS valid identifiers include any sequence enclosed
 +        * within vertical lines having no backslashes
 +        */
 +       "\\|([^\\\\]*)\\|"
 +       /* All other words should be delimited by spaces or parentheses */
 +       "|([^][)(}{[ \t])+"),
  PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",
         "\\\\[a-zA-Z@]+|\\\\.|[a-zA-Z0-9\x80-\xff]+"),
- PATTERNS("cpp",
-        /* Jump targets or access declarations */
-        "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])\n"
-        /* functions/methods, variables, and compounds at top level */
-        "^((::[[:space:]]*)?[A-Za-z_].*)$",
-        /* -- */
-        "[a-zA-Z_][a-zA-Z0-9_]*"
-        "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lLuU]*"
-        "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*"),
- PATTERNS("csharp",
-        /* Keywords */
-        "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"
-        /* Methods and constructors */
-        "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe|async)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
-        /* Properties */
-        "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
-        /* Type definitions */
-        "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
-        /* Namespace */
-        "^[ \t]*(namespace[ \t]+.*)$",
-        /* -- */
-        "[a-zA-Z_][a-zA-Z0-9_]*"
-        "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
-        "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
- IPATTERN("css",
-        "![:;][[:space:]]*$\n"
-        "^[:[@.#]?[_a-z0-9].*$",
-        /* -- */
-        /*
-         * This regex comes from W3C CSS specs. Should theoretically also
-         * allow ISO 10646 characters U+00A0 and higher,
-         * but they are not handled in this regex.
-         */
-        "-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
-        "|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
- ),
  { "default", NULL, -1, { NULL, 0 } },
  };
  #undef PATTERNS