summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-29 10:23:19 -0700
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-29 10:23:19 -0700
commitedb7e82f72106add9f2fbaf9d99d9532a72e3f91 (patch)
treea4622ea3d53d1414acd3a20eb0098140ff864cd6 /t
parentMerge branch 'mg/maint-remote-fix' into maint (diff)
parentt4018-diff-funcname: test syntax of builtin xfuncname patterns (diff)
downloadtgif-edb7e82f72106add9f2fbaf9d99d9532a72e3f91.tar.xz
Merge branch 'bc/maint-diff-hunk-header-fix' into maint
* bc/maint-diff-hunk-header-fix: t4018-diff-funcname: test syntax of builtin xfuncname patterns diff hunk pattern: fix misconverted "\{" tex macro introducers diff: use extended regexp to find hunk headers diff.*.xfuncname which uses "extended" regex's for hunk header selection diff.c: associate a flag with each pattern and use it for compiling regex diff.c: return pattern entry pointer rather than just the hunk header pattern Conflicts: Documentation/gitattributes.txt
Diffstat (limited to 't')
-rwxr-xr-xt/t4018-diff-funcname.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 18bcd9713d..99fff973eb 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 |
+ 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"
'
@@ -58,7 +69,7 @@ test_expect_success 'last regexp must not be negated' '
'
test_expect_success 'alternation in pattern' '
- git config diff.java.funcname "^[ ]*\\(\\(public\\|static\\).*\\)$"
+ git config diff.java.xfuncname "^[ ]*((public|static).*)$" &&
git diff --no-index Beer.java Beer-correct.java |
grep "^@@.*@@ public static void main("
'