git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH bc/maint-diff-hunk-header] t4018-diff-funcname: test syntax of builtin xfuncname patterns

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Sep 22, 2008, 23:19 UTC
Message-ID
<b-t750rmbNQ3RJMPXbQJmYFebFR6SfB9QBkJdDzbG7GGT_3aZBkCfw@cipher.nrlssc.navy.mil>
In-Reply-To
<7vy71n482x.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---

How about something like this on top of your ERE conversion patch. It will test that regcomp() completes successfully.

-brandon
 t/t4018-diff-funcname.sh |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 602d68f..76919a4 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -32,7 +32,18 @@ EOF
 
 sed 's/beer\\/beer,\\/' < Beer.java > Beer-correct.java
 
+builtin_patterns="bibtex java pascal ruby tex"
+for p in $builtin_patterns
+do
+	test_expect_success "builtin $p pattern compiles" '
+		echo "*.java diff=$p" > .gitattributes &&
+		git diff --no-index Beer.java Beer-correct.java 2>&1 |
+			test_must_fail grep "fatal" > /dev/null
+	'
+done
+
 test_expect_success 'default behaviour' '
+	rm -f .gitattributes &&
 	git diff --no-index Beer.java Beer-correct.java |
 	grep "^@@.*@@ public class Beer"
 '
-- 
1.6.0.1.244.gdc19
Previous: Brandon CaseyNext: Brandon Casey
Message 19 of 26 in “diff.c: return pattern entry pointer rather than just the hunk header pattern”
  1. 1/4 diff.c: return pattern entry pointer rather than just the hunk header patternBrandon Casey, Sep 18, 2008
  2. Boyd Lynn GerberSep 19, 2008
  3. Brandon CaseySep 19, 2008
  4. 2/4 diff.c: associate a flag with each pattern and use it for compiling regexBrandon Casey, Sep 18, 2008
  5. 3/4 diff.*.xfuncname which uses "extended" regex's for hunk header selectionBrandon Casey, Sep 18, 2008
  6. 4/4 diff.c: convert builtin funcname patterns to non-GNU extended regex syntaxBrandon Casey, Sep 18, 2008
  7. Brandon CaseySep 18, 2008
  8. Brandon CaseySep 19, 2008
  9. Johan HerlandSep 18, 2008
  10. Brandon CaseySep 19, 2008
  11. Junio C HamanoSep 19, 2008
  12. Junio C HamanoSep 20, 2008
  13. Brandon CaseySep 20, 2008
  14. Junio C HamanoSep 20, 2008
  15. Brandon CaseySep 22, 2008
  16. Brandon CaseySep 24, 2008
  17. Brandon CaseySep 26, 2008
  18. diff.c: remove duplicate bibtex pattern introduced by merge 92bb9785Brandon Casey, Sep 29, 2008
  19. t4018-diff-funcname: test syntax of builtin xfuncname patternsBrandon Casey, Sep 22, 2008
  20. t4018-diff-funcname: test syntax of builtin xfuncname patternsBrandon Casey, Sep 22, 2008
  21. diff funcname_pattern: Allow HTML header tags without attributesJohan Herland, Sep 23, 2008
  22. Junio C HamanoSep 23, 2008
  23. Johan HerlandSep 23, 2008
  24. Junio C HamanoSep 20, 2008
  25. Junio C HamanoSep 20, 2008
  26. Gustaf HendebySep 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.